Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Adds streaming example to README
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesseanwright committed Oct 25, 2019
1 parent be16344 commit 27769ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Reno is a thin routing library designed to sit on top of [Deno](https://deno.land/)'s [standard HTTP module](https://github.com/denoland/deno_std/tree/master/http).

```ts
```tsx
import { serve } from 'https://deno.land/[email protected]/http/server.ts';

import {
Expand All @@ -11,6 +11,7 @@ import {
RouteMap,
textResponse,
jsonResponse,
streamResponse,
} from 'https://raw.githubusercontent.com/jamesseanwright/reno/v0.2.0/reno/mod.ts';

export const routes = new RouteMap([
Expand All @@ -26,6 +27,11 @@ export const routes = new RouteMap([

return jsonResponse(await res.json());
}],

// Supports Reader for streaming responses in chunks
['/streamed-response', () => streamResponse(
new ReactReader(<App />),
],
]);

const router = createRouter(routes);
Expand Down

0 comments on commit 27769ca

Please sign in to comment.