Add legacy URL handling and update environment configurations
This commit is contained in:
parent
19f0d65896
commit
9f56dfba1d
11 changed files with 79 additions and 28 deletions
|
|
@ -3,13 +3,18 @@ import { fileURLToPath } from 'node:url';
|
|||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const defaultLocalLegacyRoot = path.resolve(__dirname, '../../../../www');
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
|
||||
function envOrDefault(name, defaultValue) {
|
||||
return process.env[name] || defaultValue;
|
||||
}
|
||||
|
||||
export const config = {
|
||||
port: Number(process.env.PORT || 3001),
|
||||
frontendUrl: process.env.FACEAI_FRONTEND_URL || 'http://localhost:5173',
|
||||
publicBaseUrl: process.env.FACEAI_PUBLIC_BASE_URL || 'http://localhost:3001',
|
||||
legacyReturnUrl: process.env.FACEAI_LEGACY_RETURN_URL || 'http://localhost:3001/dev/legacy/return',
|
||||
legacyHomeUrl: process.env.FACEAI_LEGACY_HOME_URL || 'http://localhost:8080/index.jsp',
|
||||
frontendUrl: envOrDefault('FACEAI_FRONTEND_URL', isProduction ? 'https://ai.regalamiunsorriso.it' : 'http://localhost:5173'),
|
||||
publicBaseUrl: envOrDefault('FACEAI_PUBLIC_BASE_URL', isProduction ? 'https://ai.regalamiunsorriso.it' : 'http://localhost:3001'),
|
||||
legacyReturnUrl: envOrDefault('FACEAI_LEGACY_RETURN_URL', isProduction ? 'https://www.regalamiunsorriso.it/faceai_return.php' : 'http://localhost:3001/dev/legacy/return'),
|
||||
legacyHomeUrl: envOrDefault('FACEAI_LEGACY_HOME_URL', isProduction ? 'https://www.regalamiunsorriso.it/' : 'http://localhost:8080/index.jsp'),
|
||||
pklRoot: process.env.FACEAI_PKL_ROOT || '/data/pkl',
|
||||
enableLocalLegacyStatic: process.env.FACEAI_ENABLE_LOCAL_LEGACY_STATIC
|
||||
? process.env.FACEAI_ENABLE_LOCAL_LEGACY_STATIC === '1'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue