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:
parent
44477596ed
commit
845bc443da
3 changed files with 6 additions and 6 deletions
|
@ -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" });
|
||||
}
|
||||
```
|
||||
|
|
|
@ -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" });
|
||||
}
|
||||
```
|
||||
|
|
|
@ -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 });
|
||||
* }
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue