- Zero Config — No build step. Point to routes and serve.
- File-Based Routing — Put route files in a folder, URL follows that structure.
- Context — Body, query, params, cookies, headers, plus helpers to respond.
- Middleware — Global or per path. CORS, auth, session, WebSocket.
- Static Files — Serve directories with optional cache and etag.
- Error Handling — Custom or default HTML/JSON error responses.
- Worker Pool — Offload heavy work to a pool so the server stays responsive.
- Frontend Optional — Use any frontend. Deserve stays the server.
Note
Prerequisites: Deno 2.5.4 or later.
# Add Deserve from JSR
deno add jsr:@neabyte/deserveSee the installation guide for details.
Create a routes directory and export HTTP method handlers. Start the server.
import { Router } from 'jsr:@neabyte/deserve'
// Create router and point to your routes directory
const router = new Router({ routesDir: './routes' })
// Optional: enable worker pool for CPU-bound work (ctx.state.worker.run(payload) in routes)
// const router = new Router({
// routesDir: './routes',
// worker: { scriptURL: import.meta.resolve('./worker.ts'), poolSize: 4 }
// })
// Start server on port 8000
await router.serve(8000)Example route — routes/hello.ts:
import type { Context } from 'jsr:@neabyte/deserve'
// Export GET (or POST, PUT, etc.) — path comes from file location
export function GET(ctx: Context) {
return ctx.send.json({ message: 'Hello from Deserve' })
}From the repo root (requires Deno).
Check — format, lint, and typecheck:
# Format, lint, and typecheck source
deno task checkTest — run tests (under tests/, uses --allow-read for fixtures):
# Run tests in tests/ (uses --allow-read for fixtures)
deno task testBenchmark — autocannon runs. benchmark/README.md for details.
Full documentation (EN / ID): docs-deserve.neabyte.com
- Cursor / VS Code extension: See editor/README.md
- Bugs & ideas — GitHub Issues
- Code & docs — Pull Requests welcome.
- Use it — Try Deserve in your projects and share feedback.
This project is licensed under the MIT license. See LICENSE for details.