Skip to content

Commit

Permalink
Update usage (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
hashrock authored and ry committed Dec 1, 2018
1 parent 0c8ad6e commit f574e3c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ Usage:
```typescript
import { serve } from "https://deno.land/x/net/http.ts";
const s = serve("0.0.0.0:8000");
for await (const req of s) {
req.respond({ body: "Hello World\n" });

async function main() {
for await (const req of s) {
req.respond({ body: new TextEncoder().encode("Hello World\n") });
}
}

main();
```

0 comments on commit f574e3c

Please sign in to comment.