From 3d65177dbcaf6d08c7e4a412beece8ee6939d466 Mon Sep 17 00:00:00 2001 From: tokiedokie Date: Sun, 4 Oct 2020 21:18:36 +0900 Subject: docs(std): version all imports in README (#7442) Use $STD_VERSION in std/ README files to automatically display proper version. --- std/http/README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'std/http/README.md') 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"); -- cgit v1.2.3