mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-28 01:37:44 +02:00
🐛 fix(staging): add missing PUBLIC_*_CLIENT env vars for runtime config
Web apps use hooks.server.ts to inject window.__PUBLIC_*__ variables at runtime, but docker-compose.staging.yml was only setting vars for docker-entrypoint.sh config.json. This caused web apps to fall back to localhost URLs in production. Changes: - Add PUBLIC_*_CLIENT env vars for all staging web apps - Update calendar-web hooks.server.ts to inject contacts API URL
This commit is contained in:
parent
2784143466
commit
834b11d1d1
2 changed files with 27 additions and 10 deletions
|
|
@ -11,6 +11,8 @@ const PUBLIC_MANA_CORE_AUTH_URL_CLIENT =
|
|||
process.env.PUBLIC_MANA_CORE_AUTH_URL_CLIENT || process.env.PUBLIC_MANA_CORE_AUTH_URL || '';
|
||||
const PUBLIC_BACKEND_URL_CLIENT =
|
||||
process.env.PUBLIC_BACKEND_URL_CLIENT || process.env.PUBLIC_BACKEND_URL || '';
|
||||
const PUBLIC_CONTACTS_API_URL_CLIENT =
|
||||
process.env.PUBLIC_CONTACTS_API_URL_CLIENT || process.env.PUBLIC_CONTACTS_API_URL || '';
|
||||
|
||||
export const handle: Handle = async ({ event, resolve }) => {
|
||||
return resolve(event, {
|
||||
|
|
@ -20,6 +22,7 @@ export const handle: Handle = async ({ event, resolve }) => {
|
|||
const envScript = `<script>
|
||||
window.__PUBLIC_MANA_CORE_AUTH_URL__ = "${PUBLIC_MANA_CORE_AUTH_URL_CLIENT}";
|
||||
window.__PUBLIC_BACKEND_URL__ = "${PUBLIC_BACKEND_URL_CLIENT}";
|
||||
window.__PUBLIC_CONTACTS_API_URL__ = "${PUBLIC_CONTACTS_API_URL_CLIENT}";
|
||||
</script>`;
|
||||
return html.replace('<head>', `<head>${envScript}`);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue