diff --git a/README.md b/README.md index 6e09223..064eb22 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,10 @@ Deno port of [forwarded](https://github.com/jshttp/forwarded/) library. ## Usage ```ts -import { Server } from 'https://deno.land/std@0.181.0/http/server.ts' +import { serve } from 'https://deno.land/std@0.185.0/http/server.ts' import { forwarded, parse } from 'https://deno.land/x/forwarded/mod.ts' -const s = new Server({ - port: 8080, - handler: (req) => { - return new Response(JSON.stringify(forwarded(req)) - } -}) +await serve((req) => new Response(JSON.stringify(forwarded(req)), { port: 8080 }) ``` ## API diff --git a/mod.ts b/mod.ts index 7240982..cc2b7e8 100644 --- a/mod.ts +++ b/mod.ts @@ -1,4 +1,4 @@ -import type { ConnInfo } from 'https://deno.land/std@0.181.0/http/server.ts' +import type { ConnInfo } from 'https://deno.land/std@0.185.0/http/server.ts' export type RequestWithConnection = Request & { conn: ConnInfo } diff --git a/mod_test.ts b/mod_test.ts index 48a6ca6..60b81c9 100644 --- a/mod_test.ts +++ b/mod_test.ts @@ -1,6 +1,6 @@ import type { RequestWithConnection } from './mod.ts' import { forwarded } from './mod.ts' -import type { ConnInfo } from 'https://deno.land/std@0.181.0/http/server.ts' +import type { ConnInfo } from 'https://deno.land/std@0.185.0/http/server.ts' import { describe, it, expect, run } from 'https://deno.land/x/tincan@1.0.1/mod.ts' const createReq = (hostname: string, headers?: Record): RequestWithConnection =>