mirror of
https://github.com/denoland/deno.git
synced 2025-01-07 06:46:59 -05:00
Update usage (#2)
This commit is contained in:
parent
0c8ad6eb1a
commit
f574e3c6db
1 changed files with 7 additions and 2 deletions
|
@ -7,7 +7,12 @@ Usage:
|
||||||
```typescript
|
```typescript
|
||||||
import { serve } from "https://deno.land/x/net/http.ts";
|
import { serve } from "https://deno.land/x/net/http.ts";
|
||||||
const s = serve("0.0.0.0:8000");
|
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();
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue