mirror of
https://github.com/denoland/deno.git
synced 2024-11-23 15:16:54 -05:00
parent
e931c53a23
commit
6a7c01c2f0
1 changed files with 7 additions and 2 deletions
|
@ -7,7 +7,12 @@ Usage:
|
|||
```typescript
|
||||
import { serve } from "https://deno.land/x/net/http.ts";
|
||||
const s = serve("0.0.0.0:8000");
|
||||
|
||||
async function main() {
|
||||
for await (const req of s) {
|
||||
req.respond({ body: "Hello World\n" });
|
||||
req.respond({ body: new TextEncoder().encode("Hello World\n") });
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue