mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 09:58:12 +00:00
Fare and route-coach, production checklist updates
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
import { registerAs } from '@nestjs/config';
|
||||
|
||||
export default registerAs('app', () => ({
|
||||
port: parseInt(process.env.PORT ?? '4000', 10),
|
||||
jwtSecret: process.env.JWT_SECRET ?? 'dev-secret',
|
||||
jwtExpiresIn: process.env.JWT_EXPIRES_IN ?? '7d',
|
||||
frontendUrl: process.env.PORTAL_URL ?? 'http://localhost:3000',
|
||||
portalUrl: process.env.BACK_OFFICE_URL ?? 'http://localhost:3001',
|
||||
}));
|
||||
export default registerAs('app', () => {
|
||||
const isProd = process.env.NODE_ENV === 'production';
|
||||
|
||||
if (isProd && !process.env.JWT_SECRET) {
|
||||
throw new Error('JWT_SECRET environment variable is required in production');
|
||||
}
|
||||
if (isProd && !process.env.JWT_ACCESS_TOKEN_SECRET) {
|
||||
throw new Error('JWT_ACCESS_TOKEN_SECRET environment variable is required in production');
|
||||
}
|
||||
if (isProd && !process.env.JWT_REFRESH_TOKEN_SECRET) {
|
||||
throw new Error('JWT_REFRESH_TOKEN_SECRET environment variable is required in production');
|
||||
}
|
||||
|
||||
return {
|
||||
port: parseInt(process.env.PORT ?? '4000', 10),
|
||||
jwtSecret: process.env.JWT_SECRET ?? 'dev-secret',
|
||||
jwtExpiresIn: process.env.JWT_EXPIRES_IN ?? '7d',
|
||||
frontendUrl: process.env.PORTAL_URL ?? 'http://localhost:3000',
|
||||
portalUrl: process.env.BACK_OFFICE_URL ?? 'http://localhost:3001',
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user