Skip to content
Our Sponsors
Open in Anthropic

Integration with Netlify Edge Function

Netlify Edge Function is run on Deno which is one of Elysia support runtime, as Elysia is built on top of Web Standard.

Netlify Edge Functions requires a special directory to run a function, the default is <directory>/netlify/edge-functions.

To create a function at /hello, you would need to create file at netlify/edge-functions/hello.ts, then simply export default an Elysia instance.

typescript
import { Elysia } from 'elysia'

export const config = { path: '/hello' } 

export default new Elysia({ prefix: '/hello' }) 
	.get('/', () => 'Hello Elysia')

Running locally

To test your Elysia server on Netlify Edge Function locally, you can install Netlify CLI to simluate function invokation.

To install Netlify CLI:

bash
bun add -g netlify-cli

To run the development environment:

bash
netlify dev

For an additional information, please refers to Netlify Edge Function documentation.