const config = {
  port: parseInt(process.env['PORT'] || '3001', 10),
  mongodb: {
    uri:
      process.env['MONGODB_URI'] ||
      'mongodb://meshitrack:devpassword@localhost:27017/meshitrack?authSource=admin&replicaSet=rs0',
  },
  keycloak: {
    url: process.env['KEYCLOAK_URL'] || 'http://localhost:8080',
    issuerUrl:
      process.env['KEYCLOAK_ISSUER_URL'] || process.env['KEYCLOAK_URL'] || 'http://localhost:8080',
    realm: process.env['KEYCLOAK_REALM'] || 'meshitrack',
    clientId: process.env['KEYCLOAK_CLIENT_ID'] || 'meshitrack-api',
  },
  cors: {
    origin: process.env['CORS_ORIGIN'] || 'http://localhost:3000',
  },
} as const;

export type Config = typeof config;
export default config;
