feat: add support for custom url on api pages

This commit is contained in:
DE OLIVEIRA Tristan committed 2022-01-09 03:23:02 +01:00
1 parent 93d0dbf2c5
commit 84d1fab8a9
3 files changed
+8 -8

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
import { GoTrueClient, User } from '@supabase/gotrue-js'
export const GOTRUE_URL = process.env.NEXT_PUBLIC_GOTRUE_URL || 'http://localhost:8000/auth/v1'
export const GOTRUE_URL = process.env.NEXT_PUBLIC_GOTRUE_URL || `${process.env.SUPABASE_URL}/auth/v1`
export const auth = new GoTrueClient({
url: GOTRUE_URL,
+6 -6
View File
@@ -38,11 +38,11 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
app: { id: 1, name: 'Auto API' },
app_config: {
db_schema: 'public',
endpoint: 'localhost:8000',
endpoint: process.env.SUPABASE_URL,
realtime_enabled: true,
},
endpoint: 'http://localhost:8000',
restUrl: 'http://localhost:8000/rest/v1/',
endpoint: process.env.SUPABASE_URL,
restUrl: `${process.env.SUPABASE_URL}/rest/v1/`,
defaultApiKey: process.env.SUPABASE_ANON_KEY,
serviceApiKey: process.env.SUPABASE_SERVICE_KEY,
internalApiKey: process.env.SUPABASE_ANON_KEY,
@@ -68,11 +68,11 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
app: { id: 1, name: 'Auto API' },
app_config: {
db_schema: 'public',
endpoint: 'localhost:8000',
endpoint: process.env.SUPABASE_URL,
realtime_enabled: true,
},
endpoint: 'http://localhost:8000',
restUrl: 'http://localhost:8000/rest/v1/',
endpoint: process.env.SUPABASE_URL,
restUrl: `${process.env.SUPABASE_URL}/rest/v1/`,
defaultApiKey: process.env.SUPABASE_ANON_KEY,
serviceApiKey: process.env.SUPABASE_SERVICE_KEY,
internalApiKey: process.env.SUPABASE_ANON_KEY,
@@ -55,7 +55,7 @@ const handleGetAll = async (req: NextApiRequest, res: NextApiResponse) => {
app: { id: 1, name: 'Auto API' },
app_config: {
db_schema: 'public',
endpoint: 'localhost:8000',
endpoint: process.env.SUPABASE_URL,
realtime_enabled: true,
},
},