1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-31 11:34:15 -05:00

improve docs (#5873)

This commit is contained in:
Robin Wieruch 2020-05-26 16:09:47 +02:00 committed by GitHub
parent 44477596ed
commit 845bc443da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -108,10 +108,10 @@ This time let's try with local source file, create `server.ts`:
```ts
import { serve } from "https://deno.land/std@v0.50.0/http/server.ts";
const s = serve({ port: 8000 });
const server = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
for await (const req of server) {
req.respond({ body: "Hello World\n" });
}
```

View file

@ -2,9 +2,9 @@
```typescript
import { serve } from "https://deno.land/std/http/server.ts";
const s = serve({ port: 8000 });
const server = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of s) {
for await (const req of server) {
req.respond({ body: "Hello World\n" });
}
```

View file

@ -247,8 +247,8 @@ export type HTTPOptions = Omit<Deno.ListenOptions, "transport">;
*
* import { serve } from "https://deno.land/std/http/server.ts";
* const body = "Hello World\n";
* const s = serve({ port: 8000 });
* for await (const req of s) {
* const server = serve({ port: 8000 });
* for await (const req of server) {
* req.respond({ body });
* }
*/