Skip to content

Integration with Deno

Elysia is built on top of Web Standard Request/Response, allowing us to run Elysia with Deno.serve directly.

Add Elysia to your Deno project with deno add npm:elysia@rc. Then pass app.fetch to Deno.serve:

import { Elysia } from 'elysia'
const app = new Elysia()
.get('/', () => 'Hello Elysia')
Deno.serve(app.fetch)

Then run the module with network permissions:

Terminal window
deno run --allow-net --watch src/index.ts

This is all you need to run Elysia on Deno.

You can specify the port number in Deno.serve.

Deno.serve({ port: 8787 }, app.fetch)

If your pnpm configuration does not install peer dependencies, add the peers required by Elysia v2 explicitly:

Terminal window
pnpm add typebox exact-mirror openapi-types

Type to search the documentation.

    Up arrowDown arrow to navigateEnter to selectEscape to close