Skip to content

Commit

Permalink
Update usage (denoland/std#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 e931c53 commit 6a7c01c
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 6a7c01c

Please sign in to comment.