- Create dedicated ProfanityFilter class with isolated SQLite database - Separate profanity.db from main application database to prevent SQLITE_MISUSE errors - Add comprehensive custom word management (CRUD operations) - Implement advanced profanity detection with leetspeak and pattern matching - Add admin UI for managing custom profanity words - Add extensive test suites for both profanity filter and API routes - Update server.js to use isolated profanity filter - Add proper database initialization and cleanup methods - Support in-memory databases for testing Breaking changes: - Profanity filter now uses separate database file - Updated admin API endpoints for profanity management - Enhanced profanity detection capabilities
22 lines
784 B
JavaScript
22 lines
784 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
|
|
module.exports = () => {
|
|
// Get API configuration
|
|
router.get('/', (req, res) => {
|
|
console.log('📡 API Config requested');
|
|
const MAPBOX_ACCESS_TOKEN = process.env.MAPBOX_ACCESS_TOKEN || null;
|
|
|
|
console.log('MapBox token present:', !!MAPBOX_ACCESS_TOKEN);
|
|
console.log('MapBox token starts with pk:', MAPBOX_ACCESS_TOKEN?.startsWith('pk.'));
|
|
|
|
res.json({
|
|
// MapBox tokens are designed to be public (they have domain restrictions)
|
|
mapboxAccessToken: MAPBOX_ACCESS_TOKEN,
|
|
hasMapbox: !!MAPBOX_ACCESS_TOKEN
|
|
// SECURITY: Google Maps API key is kept server-side only
|
|
});
|
|
});
|
|
|
|
return router;
|
|
};
|