Skip to content

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

update self hosting function docs

Inian124f477b84d5
diff --git a/apps/docs/docs/ref/self-hosting-functions/introduction.mdx b/apps/docs/docs/ref/self-hosting-functions/introduction.mdx
index 76440809eee..46ebfef9423 100644
--- a/apps/docs/docs/ref/self-hosting-functions/introduction.mdx
+++ b/apps/docs/docs/ref/self-hosting-functions/introduction.mdx
@@ -14,20 +14,61 @@ hideTitle: true
<RefSubLayout.EducationRow>
<RefSubLayout.Details>
-The Supabase Functions
+A web server based on [Deno](https://deno.land) runtime, capable of running JavaScript, TypeScript, and WASM services.
+
+You can use it to:
+
+- Locally test and self-host Supabase's Edge Functions (or any Deno Edge Function)
+- As a programmable HTTP Proxy: You can intercept / route HTTP requests
+
+**WARNING: Beta Software. There will be breaking changes to APIs / Configuration Options**
+
+## How to run locally
+
+```bash
+./run.sh start --main-service /path/to/supabase/functions -p 9000
+```
+
+using Docker:
+
+```bash
+docker build -t edge-runtime .
+docker run -it --rm -p 9000:9000 -v /path/to/supabase/functions:/usr/services supabase/edge-runtime start --main-service /usr/services
+```
+
+## How to update to a newer Deno version
+
+- Select the Deno version to upgrade and visit its tag on GitHub (eg: https://github.com/denoland/deno/blob/v1.30.3/Cargo.toml)
+- Open the `Cargo.toml` at the root of of this repo and modify all `deno_*` modules to match to the selected tag of Deno.
+
+## Self hosting Edge Functions on Fly.io
+
+We have put together a demo on how to self-host edge functions on [Fly.io](http://Fly.io) (you can also use other providers like Digital Ocean or AWS).
+
+To try it yourself,
+
+- Sign up for an [Fly.io](http://Fly.io) account and install [flyctl](https://fly.io/docs/hands-on/install-flyctl/)
+- Clone the demo repository to your machine - https://github.com/supabase/self-hosted-edge-functions-demo
+- Copy your Edge Function into the `./functions` directory in the demo repo.
+- Update the Dockerfile to pull the latest edge-runtime image (check [releases](https://github.com/supabase/edge-runtime/pkgs/container/edge-runtime))
+- [Optional] Edit `./functions/main/index.ts`, adding any other request preprocessing logic (for example, you can enable JWT validation, handle CORS requests)
+- Run `fly launch` to create a new app to serve your Edge Functions
+- Access your Edge Function by visiting:
+ `https://{your-app-name}.fly.dev/{your-function-name}`
+
+You can view the logs for the Edge Runtime, by visiting Fly.io’s Dashboard > Your App > Metrics. Also, you can serve edge-runtime from multiple regions by running `fly regions add [REGION]`.
</RefSubLayout.Details>
<RefSubLayout.Examples>
### Client libraries
+ - [JavaScript](https://supabase.com/docs/reference/javascript/functions-invoke)
+ - [Dart](https://supabase.com/docs/reference/dart/functions-invoke)
- - [JavaScript - Pino Transport](https://github.com/Logflare/pino-logflare)
-
-
- ### Additional links
+ ### Additional Links
- - [Source code](https://github.com/logflare/logflare)
+ - [Source code](https://github.com/supabase/edge-runtime/)
</RefSubLayout.Examples>
diff --git a/spec/common-self-hosting-functions-sections.json b/spec/common-self-hosting-functions-sections.json
index 36d0aefad0e..0ffa94e1b1a 100644
--- a/spec/common-self-hosting-functions-sections.json
+++ b/spec/common-self-hosting-functions-sections.json
@@ -5,22 +5,5 @@
"slug": "introduction",
"summary": "Introduction",
"type": "markdown"
- },
- {
- "title": "Management API",
- "items": [
- {
- "id": "list-endpoints",
- "slug": "list-endpoints",
- "title": "List endpoints",
- "type": "operation"
- },
- {
- "id": "create-endpoint",
- "slug": "create-endpoint",
- "title": "Create endpoint",
- "type": "operation"
- }
- ]
}
]