summaryrefslogtreecommitdiff
path: root/std/http/README.md
diff options
context:
space:
mode:
authortokiedokie <thetokiedokie@gmail.com>2020-10-04 21:18:36 +0900
committerGitHub <noreply@github.com>2020-10-04 14:18:36 +0200
commit3d65177dbcaf6d08c7e4a412beece8ee6939d466 (patch)
tree53b5954f612daa559f8e893471083f854ea63464 /std/http/README.md
parentec963238230c7f92a29da27ced0a2ec706af92d0 (diff)
docs(std): version all imports in README (#7442)
Use $STD_VERSION in std/ README files to automatically display proper version.
Diffstat (limited to 'std/http/README.md')
-rw-r--r--std/http/README.md17
1 files changed, 10 insertions, 7 deletions
diff --git a/std/http/README.md b/std/http/README.md
index be41f4fe1..cd23ec41b 100644
--- a/std/http/README.md
+++ b/std/http/README.md
@@ -1,7 +1,7 @@
# http
```typescript
-import { serve } from "https://deno.land/std/http/server.ts";
+import { serve } from "https://deno.land/std@$STD_VERSION/http/server.ts";
const server = serve({ port: 8000 });
console.log("http://localhost:8000/");
for await (const req of server) {
@@ -23,8 +23,8 @@ deno run --allow-net --allow-read https://deno.land/std/http/file_server.ts
Helper to manipulate `Cookie` through `ServerRequest` and `Response`.
```ts
-import { ServerRequest } from "https://deno.land/std/http/server.ts";
-import { getCookies } from "https://deno.land/std/http/cookie.ts";
+import { ServerRequest } from "https://deno.land/std@$STD_VERSION/http/server.ts";
+import { getCookies } from "https://deno.land/std@$STD_VERSION/http/cookie.ts";
let request = new ServerRequest();
request.headers = new Headers();
@@ -38,8 +38,11 @@ console.log("cookies:", cookies);
To set a `Cookie` you can add `CookieOptions` to properly set your `Cookie`:
```ts
-import { Response } from "https://deno.land/std/http/server.ts";
-import { Cookie, setCookie } from "https://deno.land/std/http/cookie.ts";
+import { Response } from "https://deno.land/std@$STD_VERSION/http/server.ts";
+import {
+ Cookie,
+ setCookie,
+} from "https://deno.land/std@$STD_VERSION/http/cookie.ts";
let response: Response = {};
const cookie: Cookie = { name: "Space", value: "Cat" };
@@ -54,8 +57,8 @@ Deleting a `Cookie` will set its expiration date before now. Forcing the browser
to delete it.
```ts
-import { Response } from "https://deno.land/std/http/server.ts";
-import { deleteCookie } from "https://deno.land/std/http/cookie.ts";
+import { Response } from "https://deno.land/std@$STD_VERSION/http/server.ts";
+import { deleteCookie } from "https://deno.land/std@$STD_VERSION/http/cookie.ts";
let response: Response = {};
deleteCookie(response, "deno");