Put API prefix in server only file to access process.env

This commit is contained in:
thiloho
2024-08-19 20:33:23 +02:00
parent 488877b2ed
commit 28774dc944
15 changed files with 29 additions and 25 deletions

View File

@@ -0,0 +1,3 @@
import { dev } from "$app/environment";
export const API_BASE_PREFIX = dev ? "http://localhost:3000" : `${process.env.ORIGIN}/api`;