Skip to content

Commit c4308e5

Browse files
committed
docs(readme): refresh features, prerequisites, and examples
- Add CSRF, IP, and Observability to the feature list - Bump Deno prerequisite and badge from 2.5.4 to 2.7.0 - Drop Frontend Optional feature bullet - Normalize em dashes to hyphens across sections - Remove stale Hot Reload doc link from quick start - Trim quick-start router comments and type the GET handler
1 parent 9fc5328 commit c4308e5

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44

55
Build HTTP server effortlessly with zero configuration for productivity.
66

7-
[![Deno](https://img.shields.io/badge/deno-2.5.4+-000000?logo=deno&logoColor=white)](https://deno.com) [![JSR](https://jsr.io/badges/@neabyte/deserve)](https://jsr.io/@neabyte/deserve) [![CI](https://github.com/NeaByteLab/Deserve/actions/workflows/ci.yaml/badge.svg)](https://github.com/NeaByteLab/Deserve/actions/workflows/ci.yaml) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7+
[![Deno](https://img.shields.io/badge/deno-2.7.0+-000000?logo=deno&logoColor=white)](https://deno.com) [![JSR](https://jsr.io/badges/@neabyte/deserve)](https://jsr.io/@neabyte/deserve) [![CI](https://github.com/NeaByteLab/Deserve/actions/workflows/ci.yaml/badge.svg)](https://github.com/NeaByteLab/Deserve/actions/workflows/ci.yaml) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
88

99
</div>
1010

1111
## Features
1212

13-
- **Zero Config** No build step. Point to routes and serve.
14-
- **File-Based Routing** Put route files in a folder, URL follows that structure.
15-
- **Context** Body, query, params, cookies, headers, plus helpers to respond.
16-
- **Middleware** Global or per path. CORS, auth, session, WebSocket.
17-
- **Static Files** Serve directories with optional cache and etag.
18-
- **Error Handling** Custom or default HTML/JSON error responses.
19-
- **Hot Reload** — Routes and templates reload automatically when files change.
20-
- **Worker Pool** — Offload heavy work to a pool so the server stays responsive.
21-
- **Frontend Optional** — Use any frontend. Deserve stays the server.
13+
- **Zero Config** - No build step. Point to routes and serve.
14+
- **File-Based Routing** - Put route files in a folder, URL follows that structure.
15+
- **Context** - Body, query, params, cookies, headers, plus helpers to respond.
16+
- **Middleware** - Global or per path. CORS, CSRF, IP, auth, session, WebSocket.
17+
- **Static Files** - Serve directories with optional cache and etag.
18+
- **Error Handling** - Custom or default HTML/JSON error responses.
19+
- **Observability** - Subscribe to lifecycle, request, and error events.
20+
- **Hot Reload** - Routes and templates reload automatically when files change.
21+
- **Worker Pool** - Offload heavy work to a pool so the server stays responsive.
2222

2323
## Installation
2424

2525
> [!NOTE]
26-
> **Prerequisites:** [Deno](https://deno.com/) 2.5.4 or later.
26+
> **Prerequisites:** [Deno](https://deno.com/) 2.7.0 or later.
2727
2828
```bash
2929
# Add Deserve from JSR
@@ -39,54 +39,54 @@ Create a routes directory and export HTTP method handlers. Start the server.
3939
```typescript
4040
import { Router } from 'jsr:@neabyte/deserve'
4141

42-
// Create router and point to your routes directory
42+
// Create router pointing at routes directory
4343
const router = new Router({ routesDir: './routes' })
4444

45-
// Optional: enable worker pool for CPU-bound work (ctx.state.worker.run(payload) in routes)
45+
// Optional worker pool for CPU-bound work
4646
// const router = new Router({
4747
// routesDir: './routes',
4848
// worker: { scriptURL: import.meta.resolve('./worker.ts'), poolSize: 4 }
4949
// })
50+
// Read handle: ctx.getState('worker' as never)
5051

5152
// Start server on port 8000
5253
await router.serve(8000)
5354
```
5455

55-
**Example route** `routes/hello.ts`:
56+
**Example route** in `routes/hello.ts`:
5657

5758
```typescript
5859
import type { Context } from 'jsr:@neabyte/deserve'
5960

60-
// Export GET (or POST, PUT, etc.) — path comes from file location
61-
export function GET(ctx: Context) {
61+
// Export GET, POST, PUT, path from file location
62+
export function GET(ctx: Context): Response {
6263
return ctx.send.json({ message: 'Hello from Deserve' })
6364
}
6465
```
6566

6667
- [Quick Start (Docs)](https://docs-deserve.neabyte.com/en/getting-started/quick-start)
6768
- [File-Based Routing](https://docs-deserve.neabyte.com/en/core-concepts/file-based-routing)
68-
- [Hot Reload](https://docs-deserve.neabyte.com/en/core-concepts/hot-reload)
6969
- [Example Implementation](example/README.md)
7070

7171
## Build & Test
7272

7373
From the repo root (requires [Deno](https://deno.com/)).
7474

75-
**Check** format, lint, and typecheck:
75+
**Check** - format, lint, and typecheck:
7676

7777
```bash
7878
# Format, lint, and typecheck source
7979
deno task check
8080
```
8181

82-
**Test** run tests (under `tests/`, uses `--allow-read` for fixtures):
82+
**Test** - run tests (under `tests/`, uses `--allow-read` for fixtures):
8383

8484
```bash
8585
# Run tests in tests/ (uses --allow-read for fixtures)
8686
deno task test
8787
```
8888

89-
**Benchmark** autocannon runs. [benchmark/README.md](benchmark/README.md) for details.
89+
**Benchmark** - autocannon runs. [benchmark/README.md](benchmark/README.md) for details.
9090

9191
## Documentation
9292

@@ -98,9 +98,9 @@ Full documentation (EN / ID): **[docs-deserve.neabyte.com](https://docs-deserve.
9898

9999
## Contributing
100100

101-
- **Bugs & ideas** [GitHub Issues](https://github.com/NeaByteLab/Deserve/issues)
102-
- **Code & docs** [Pull Requests](https://github.com/NeaByteLab/Deserve/pulls) welcome.
103-
- **Use it** Try Deserve in your projects and share feedback.
101+
- **Bugs & ideas** - [GitHub Issues](https://github.com/NeaByteLab/Deserve/issues)
102+
- **Code & docs** - [Pull Requests](https://github.com/NeaByteLab/Deserve/pulls) welcome.
103+
- **Use it** - Try Deserve in real projects and share feedback.
104104

105105
## License
106106

0 commit comments

Comments
 (0)