initial wcag-ada
This commit is contained in:
parent
042b8cb83a
commit
d52cfe7de2
112 changed files with 9069 additions and 0 deletions
39
apps/wcag-ada/api/src/config.ts
Normal file
39
apps/wcag-ada/api/src/config.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import { initializeWcagConfig, getWcagConfig } from '@wcag-ada/config';
|
||||
|
||||
// Initialize configuration for API service
|
||||
const appConfig = initializeWcagConfig('api');
|
||||
|
||||
// Export a config object that matches the expected interface
|
||||
export const config = {
|
||||
NODE_ENV: appConfig.environment as 'development' | 'production' | 'test',
|
||||
PORT: appConfig.services.api.port,
|
||||
|
||||
// Database
|
||||
DATABASE_URL: process.env.DATABASE_URL ||
|
||||
`postgresql://${appConfig.database.postgres.user || 'postgres'}:${appConfig.database.postgres.password || 'postgres'}@${appConfig.database.postgres.host}:${appConfig.database.postgres.port}/${appConfig.database.postgres.database}`,
|
||||
REDIS_URL: `redis://${appConfig.worker.redis.host}:${appConfig.worker.redis.port}/${appConfig.worker.redis.db}`,
|
||||
|
||||
// Auth
|
||||
JWT_SECRET: appConfig.providers.auth.jwt.secret,
|
||||
JWT_EXPIRES_IN: appConfig.providers.auth.jwt.expiresIn,
|
||||
|
||||
// Scanner
|
||||
SCANNER_CONCURRENCY: appConfig.scanner.concurrency,
|
||||
SCANNER_TIMEOUT: appConfig.scanner.timeout,
|
||||
|
||||
// API Rate Limiting
|
||||
API_RATE_LIMIT: appConfig.services.api.rateLimit.max,
|
||||
API_RATE_WINDOW: appConfig.services.api.rateLimit.windowMs,
|
||||
|
||||
// Storage
|
||||
REPORT_STORAGE_PATH: `${appConfig.providers.storage.local.basePath}/${appConfig.providers.storage.local.reports}`,
|
||||
SCREENSHOT_STORAGE_PATH: `${appConfig.providers.storage.local.basePath}/${appConfig.providers.storage.local.screenshots}`,
|
||||
|
||||
// CORS
|
||||
CORS_ORIGIN: appConfig.services.api.cors.origin,
|
||||
};
|
||||
|
||||
export type Config = typeof config;
|
||||
|
||||
// Export the full app config for advanced usage
|
||||
export { appConfig };
|
||||
Loading…
Add table
Add a link
Reference in a new issue