feat: implement user authentication and login modal, refactor backend
This commit is contained in:
34
web/backend/config/constants.js
Normal file
34
web/backend/config/constants.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import { fileURLToPath } from 'url';
|
||||
import { dirname, join } from 'path';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// En Docker, usar PROJECT_ROOT de env, sino usar ruta relativa
|
||||
// Desde config/constants.js necesitamos ir 3 niveles arriba para llegar al root del proyecto
|
||||
const PROJECT_ROOT = process.env.PROJECT_ROOT || join(__dirname, '../../..');
|
||||
|
||||
export const PATHS = {
|
||||
PROJECT_ROOT,
|
||||
CONFIG: join(PROJECT_ROOT, 'config.yaml'),
|
||||
WORKERS: join(PROJECT_ROOT, 'workers.json'),
|
||||
PUSH_SUBSCRIPTIONS: join(PROJECT_ROOT, 'push-subscriptions.json'),
|
||||
VAPID_KEYS: join(PROJECT_ROOT, 'vapid-keys.json'),
|
||||
};
|
||||
|
||||
export const SERVER = {
|
||||
PORT: process.env.PORT || 3001,
|
||||
};
|
||||
|
||||
export const RATE_LIMIT = {
|
||||
POINTS: 100,
|
||||
DURATION: 60, // segundos
|
||||
BLOCK_DURATION: 60, // segundos
|
||||
};
|
||||
|
||||
export const ARTICLE_MONITORING = {
|
||||
CHECK_INTERVAL: 3000, // milisegundos
|
||||
};
|
||||
|
||||
export const VAPID_CONTACT = 'mailto:admin@pribyte.cloud';
|
||||
|
||||
Reference in New Issue
Block a user