Skip to content
Our Sponsors
Open in Anthropic

Integration with Netlify Edge Function ​

Netlify Edge Functions run on Deno, which is one of Elysia's supported runtimes, as Elysia is built on top of Web Standards.

Netlify Edge Functions require 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 a 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 Functions locally, you can install the Netlify CLI to simulate function invocation.

To install Netlify CLI:

bash
bun add -g netlify-cli

To run the development environment:

bash
netlify dev

For additional information, please refer to the Netlify Edge Functions documentation.

pnpm ​

If you use pnpm, pnpm doesn't auto install peer dependencies by default forcing you to install additional dependencies manually.

bash
pnpm add @sinclair/typebox openapi-types