feat(config): add ability to override apiUrl in environment variables (#1581)

This commit is contained in:
morihoos
2024-02-07 16:17:03 +01:00
committed by GitHub
parent 3320dc6bc4
commit 6bba2c82fe

View File

@@ -18,7 +18,7 @@ const port = process.env.PORT || '3000';
const serveWebAppSeparately =
process.env.SERVE_WEB_APP_SEPARATELY === 'true' ? true : false;
let apiUrl = new URL(`${protocol}://${host}:${port}`).toString();
let apiUrl = new URL(process.env.API_URL || `${protocol}://${host}:${port}`).toString();
apiUrl = apiUrl.substring(0, apiUrl.length - 1);
// use apiUrl by default, which has less priority over the following cases