mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:01:09 +02:00
🐛 fix: use dynamic env for MIDDLEWARE_URL in server middleware
- Replace static private env import with dynamic env - Add default value for MIDDLEWARE_URL - Fixes build error where MIDDLEWARE_URL wasn't defined
This commit is contained in:
parent
2c30867251
commit
b8d1067414
1 changed files with 3 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { MIDDLEWARE_URL } from '$env/static/private';
|
||||
import { env } from '$env/dynamic/private';
|
||||
|
||||
/**
|
||||
* Server-side only middleware client
|
||||
|
|
@ -12,6 +12,8 @@ export async function callMiddleware(
|
|||
headers?: Record<string, string>;
|
||||
} = {}
|
||||
) {
|
||||
const MIDDLEWARE_URL =
|
||||
env.MIDDLEWARE_URL || 'https://mana-core-middleware-111768794939.europe-west3.run.app';
|
||||
const url = `${MIDDLEWARE_URL}${endpoint}`;
|
||||
|
||||
const response = await fetch(url, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue