Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: update edge functions url schema

delgado3d9a89443b583a
diff --git a/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx b/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx
index 3808a5bf36d..9d0ab774c0c 100644
--- a/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx
+++ b/studio/components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.tsx
@@ -60,13 +60,7 @@ const EdgeFunctionDetails: FC<Props> = () => {
: '[YOUR ANON KEY]'
const endpoint = apiService?.app_config.endpoint ?? ''
- const endpointSections = endpoint.split('.')
- const functionsEndpoint = [
- ...endpointSections.slice(0, 1),
- 'functions',
- ...endpointSections.slice(1),
- ].join('.')
- const functionUrl = `${apiService?.protocol}://${functionsEndpoint}/${selectedFunction?.slug}`
+ const functionUrl = `${apiService?.protocol}://${endpoint}/functions/v1/${selectedFunction?.slug}`
const { managementCommands, secretCommands, invokeCommands } = generateCLICommands(
selectedFunction,
diff --git a/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx b/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx
index 9b90a9c2539..cea9b1e2fb2 100644
--- a/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx
+++ b/studio/components/interfaces/Functions/EdgeFunctionsListItem.tsx
@@ -23,7 +23,7 @@ const EdgeFunctionsListItem: FC<Props> = ({ function: item }) => {
// get the .co or .net TLD from the restUrl
const restUrl = ui.selectedProject?.restUrl
const restUrlTld = new URL(restUrl as string).hostname.split('.').pop()
- const functionUrl = `https://${ref}.functions.supabase.${restUrlTld}/${item.slug}`
+ const functionUrl = `https://${ref}.supabase.${restUrlTld}/functions/v1/${item.slug}`
return (
<Table.tr
diff --git a/studio/components/interfaces/Functions/TerminalInstructions.tsx b/studio/components/interfaces/Functions/TerminalInstructions.tsx
index a4448748dbd..3862be68f51 100644
--- a/studio/components/interfaces/Functions/TerminalInstructions.tsx
+++ b/studio/components/interfaces/Functions/TerminalInstructions.tsx
@@ -26,12 +26,7 @@ const TerminalInstructions: FC<Props> = ({ closable = false, removeBorder = fals
: '[YOUR ANON KEY]'
const endpoint = settings?.autoApiService.app_config.endpoint ?? ''
- const endpointSections = endpoint.split('.')
- const functionsEndpoint = [
- ...endpointSections.slice(0, 1),
- 'functions',
- ...endpointSections.slice(1),
- ].join('.')
+ const functionsEndpoint = `${endpoint}/functions/v1`
// get the .co or .net TLD from the restUrl
const restUrl = settings?.autoApiService.restUrl
@@ -64,7 +59,7 @@ const TerminalInstructions: FC<Props> = ({ closable = false, removeBorder = fals
comment: 'Deploy your function',
},
{
- command: `curl -L -X POST 'https://${projectRef}.functions.supabase.${restUrlTld}/hello-world' -H 'Authorization: Bearer ${
+ command: `curl -L -X POST 'https://${projectRef}.supabase.${restUrlTld}/functions/v1/hello-world' -H 'Authorization: Bearer ${
anonKey ?? '[YOUR ANON KEY]'
}' --data '{"name":"Functions"}'`,
description: 'Invokes the hello-world function',