mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-23 16:06:43 +02:00
Port 3060 was already taken by api-gateway. Updated mana-credits to 3061. Changes: - docker-compose.macmini.yml: Add mana-credits service with health check, traefik labels for credits.mana.how, depends on postgres - docker-compose.macmini.yml: Add MANA_CREDITS_URL to mana-auth env - Update all port references from 3060 to 3061 (config, Dockerfile, CLAUDE.md) - Update better-auth.service.ts fallback URLs to 3061 - Update .env.development MANA_CREDITS_URL Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
/**
|
|
* Application configuration loaded from environment variables.
|
|
*/
|
|
|
|
export interface Config {
|
|
port: number;
|
|
databaseUrl: string;
|
|
manaAuthUrl: string;
|
|
serviceKey: string;
|
|
baseUrl: string;
|
|
stripe: {
|
|
secretKey: string;
|
|
webhookSecret: string;
|
|
};
|
|
cors: {
|
|
origins: string[];
|
|
};
|
|
}
|
|
|
|
export function loadConfig(): Config {
|
|
const requiredEnv = (key: string, fallback?: string): string => {
|
|
const value = process.env[key] || fallback;
|
|
if (!value) throw new Error(`Missing required env var: ${key}`);
|
|
return value;
|
|
};
|
|
|
|
return {
|
|
port: parseInt(process.env.PORT || '3061', 10),
|
|
databaseUrl: requiredEnv(
|
|
'DATABASE_URL',
|
|
'postgresql://manacore:devpassword@localhost:5432/mana_credits'
|
|
),
|
|
manaAuthUrl: requiredEnv('MANA_CORE_AUTH_URL', 'http://localhost:3001'),
|
|
serviceKey: requiredEnv('MANA_CORE_SERVICE_KEY', 'dev-service-key'),
|
|
baseUrl: requiredEnv('BASE_URL', 'http://localhost:3060'),
|
|
stripe: {
|
|
secretKey: process.env.STRIPE_SECRET_KEY || '',
|
|
webhookSecret: process.env.STRIPE_WEBHOOK_SECRET || '',
|
|
},
|
|
cors: {
|
|
origins: (process.env.CORS_ORIGINS || 'http://localhost:5173').split(','),
|
|
},
|
|
};
|
|
}
|