This commit is contained in:
seb
2026-09-29 10:27:23 +02:00
parent 62d46a1df3
commit 3089cc7252
8 changed files with 454 additions and 34 deletions

View File

@@ -5,8 +5,18 @@ import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
dotenv.config({ path: resolve(__dirname, '../../.env'), quiet: true });
function parseHttpsPort(val) {
if (val === undefined || val === '') return 8443;
if (val === 'false' || val === '0' || val === 'none' || val === 'disabled') return null;
const n = Number(val);
return Number.isInteger(n) && n > 0 ? n : 8443;
}
export default {
port: Number(process.env.PORT) || 4208,
httpsPort: parseHttpsPort(process.env.HTTPS_PORT),
httpsKeyPath: process.env.HTTPS_KEY_PATH || resolve(__dirname, '../../certs/key.pem'),
httpsCertPath: process.env.HTTPS_CERT_PATH || resolve(__dirname, '../../certs/cert.pem'),
bodyLimit: process.env.BODY_LIMIT || '100mb',
corsOrigins: (process.env.CORS_ORIGINS || 'http://localhost:5173')
.split(',')