diff options
Diffstat (limited to 'std/http/README.md')
-rw-r--r-- | std/http/README.md | 17 |
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"); |