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:
deno run --allow-net --watch src/index.tsThis is all you need to run Elysia on Deno.
Change the port number
Section titled “Change the port number”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:
pnpm add typebox exact-mirror openapi-types