mirror of
https://github.com/sakaljurgis/best-choice.git
synced 2026-07-08 21:47:40 +00:00
19 lines
559 B
TypeScript
19 lines
559 B
TypeScript
import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { config } from 'dotenv';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
const rootDir = path.resolve(__dirname, '../../..');
|
|
|
|
config({ path: path.resolve(rootDir, '.env') });
|
|
|
|
const port = Number(process.env.SERVER_PORT ?? process.env.PORT ?? 3000);
|
|
|
|
export const env = {
|
|
port,
|
|
apiBasePath: process.env.API_BASE_PATH ?? '/api',
|
|
databaseUrl: process.env.DATABASE_URL ?? '',
|
|
appName: process.env.APP_NAME ?? 'BestChoice'
|
|
};
|