Mount
WinterTC is a standard for building HTTP servers behind Cloudflare, Deno, Vercel, and other runtimes.
It allows web servers to run interoperably across runtimes by using the standard Request and Response objects.
Elysia is WinterTC‑compliant, optimized to run on Bun, but also supports other runtimes when possible.
This enables any framework or code that follows the WinterCG standard to be run together, letting frameworks such as Elysia, Hono, Remix, Itty‑Router coexist in a single function.
Mount
To use .mount, simply pass a fetch function:
import { Elysia } from 'elysia'
import { Hono } from 'hono'
const hono = new Hono()
.get('/', (c) => c.text('Hello from Hono!'))
const app = new Elysia()
.get('/', () => 'Hello from Elysia')
.mount('/hono', hono.fetch)
Any framework that uses Request and Response can interoperate with Elysia, e.g.:
- Hono
- Nitro
- H3
- Next.js API Route
- Nuxt API Route
- SvelteKit API Route
And these can run on multiple runtimes such as:
- Bun
- Deno
- Vercel Edge Runtime
- Cloudflare Worker
- Netlify Edge Function
If the framework also exposes a .mount function, you can mount Elysia inside that framework:
import { Elysia } from 'elysia'
import { Hono } from 'hono'
const elysia = new Elysia()
.get('/', () => 'Hello from Elysia inside Hono inside Elysia')
const hono = new Hono()
.get('/', (c) => c.text('Hello from Hono!'))
.mount('/elysia', elysia.fetch)
const main = new Elysia()
.get('/', () => 'Hello from Elysia')
.mount('/hono', hono.fetch)
.listen(3000)
Reusing Elysia
You can also reuse multiple existing Elysia projects on the same server:
import { Elysia } from 'elysia'
import A from 'project-a/elysia'
import B from 'project-b/elysia'
import C from 'project-c/elysia'
new Elysia()
.mount(A)
.mount(B)
.mount(C)
When an instance passed to mount is an Elysia instance, it is automatically resolved with use, providing type‑safety and Eden support by default.
This makes interoperable frameworks and runtimes a reality.