Description
Add WebSocket support to the project templates. Hono supports WebSocket connections on both Cloudflare Workers (via Durable Objects) and Node.js — this extends Nerva beyond pure REST APIs.
Why
Real-time features (notifications, live updates, chat) are increasingly common in modern APIs. WebSocket support makes Nerva suitable for a broader range of applications without requiring users to bring a separate real-time framework.
Acceptance Criteria
Implementation Notes
Hono's WebSocket helper:
```typescript
import { upgradeWebSocket } from 'hono/cloudflare-workers';
// or
import { createNodeWebSocket } from '@hono/node-ws';
app.get('/ws', upgradeWebSocket((c) => ({
onMessage(event, ws) { /* handle message / },
onClose() { / cleanup */ },
})));
```
Description
Add WebSocket support to the project templates. Hono supports WebSocket connections on both Cloudflare Workers (via Durable Objects) and Node.js — this extends Nerva beyond pure REST APIs.
Why
Real-time features (notifications, live updates, chat) are increasingly common in modern APIs. WebSocket support makes Nerva suitable for a broader range of applications without requiring users to bring a separate real-time framework.
Acceptance Criteria
Implementation Notes
Hono's WebSocket helper:
```typescript
import { upgradeWebSocket } from 'hono/cloudflare-workers';
// or
import { createNodeWebSocket } from '@hono/node-ws';
app.get('/ws', upgradeWebSocket((c) => ({
onMessage(event, ws) { /* handle message / },
onClose() { / cleanup */ },
})));
```