https://github.com/supabase/self-hosted-edge-functions-demo
A demo of how to self-host Supabase Edge Functions on Fly.io
https://github.com/supabase/self-hosted-edge-functions-demo
Last synced: 10 months ago
JSON representation
A demo of how to self-host Supabase Edge Functions on Fly.io
- Host: GitHub
- URL: https://github.com/supabase/self-hosted-edge-functions-demo
- Owner: supabase
- Created: 2023-04-04T01:26:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-09T09:13:56.000Z (about 3 years ago)
- Last Synced: 2024-04-13T21:54:15.927Z (over 2 years ago)
- Language: TypeScript
- Size: 13.7 KB
- Stars: 60
- Watchers: 22
- Forks: 13
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Self-Host Supabase Edge Functions Demo
## Deploy to Fly.io
- Clone this repository.
- Copy your edge functions to `./functions` directory.
- [Optional] Modify the `./functions/main/index.ts` to add custom request handling and routing logic.
- Open `fly.toml` and update the app name and optionally the region etc.
- In your terminal, run `fly apps create` and sepcify the app name you just set in your `fly.toml` file.
- Finally, run `fly deploy`.
## Run locally
- Build the container image: `docker compose up --build`
- Visit http://localhost:8000/oak
File changes in the `/functions` directory will automatically be detected, except for the `/main/index.ts` function as it is a long running server.