// server.tsimport{ Elysia }from'elysia'const app =newElysia().post('/auth/sign-in', signIn, signModel).listen(8080)exporttypeApp=typeof app
// client.tsimport{ edenTreaty }from'@elysiajs/eden'importtype{ App }from'server'const api =edenTreaty<App>('http://0.0.0.0:8080')// Fully type-safe both client/server like tRPCawait api.auth.signIn.post(data)
newElysia().get('/',()=>'hello world').post('/',({ body, set })=>{
set.status =418return body
}).get('/awesome-music',({ set })=>{
set.redirect ='https://youtu.be/dQw4w9WgXcQ'})
Familiar syntax that clicks
Picking up from Node.js, Elysia is easy to get started with as it has familar syntax like most of the framework.
Also with great support of TypeScript, you will have the best experience with inferred types and autocomplete.
Measure in requests/second. Benchmark for parsing query, path parameter and set response header on Debian 11, Intel i7-13700K tested on Bun 0.5.7 at 8 Mar 2023.
Fast by default
Powered by Bun means faster than Node.js by default.
Optimized for Bun and JavaScript Core. Curated from selective benchmark from various real-world situations.