Files
supabase/studio/pages/api/constants.ts
T
Inian 0868ee96f2 fix: assume http by default if local dev
https://localhost had cert issues. the user can override with a https SUPABASE_PUBLIC_URL if required and we will pick that up
2022-12-14 17:27:52 +08:00

6 lines
278 B
TypeScript

const PUBLIC_URL = new URL(process.env.SUPABASE_PUBLIC_URL || 'http://localhost:8000')
export const PROJECT_REST_URL = `${PUBLIC_URL.origin}/rest/v1/`
export const PROJECT_ENDPOINT = PUBLIC_URL.host
export const PROJECT_ENDPOINT_PROTOCOL = PUBLIC_URL.protocol.replace(':', '')