Note
Prerequisites:Deno 2.8.3 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'@neabyte/deserve'// Create router pointing at routes directoryconstrouter=newRouter({routes: {directory: './routes'}})// Optional worker pool for CPU-bound work// const router = new Router({// routes: { directory: './routes' },// worker: { scriptURL: import.meta.resolve('./worker.ts'), poolSize: 4 }// })// Read handle: ctx.get.worker()// Start server on port 8000awaitrouter.serve(8000)Example route in routes/hello.ts:
importtype{Context}from'@neabyte/deserve'// Export GET, POST, PUT, path from file locationexportfunctionGET(ctx: Context): Response{returnctx.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 --allow-net):
# Run tests in tests/ (uses --allow-read --allow-net)
deno task testBenchmark - autocannon runs. benchmark/README.md for details.
Full documentation (EN / ID): docs-deserve.neabyte.com
- Cursor / VS Code extension: See DVE Editor
- Bugs & ideas - GitHub Issues
- Code & docs - Pull Requests welcome.
- Use it - Try Deserve in real projects and share feedback.
This project is licensed under the MIT license. See LICENSE for details.