Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

serve

import { serve } from "https://raw.githubusercontent.com/lucacasonato/deno-fetchevent/master/mod.ts";

Start an HTTP server with given options

const options = { port: 443 };
for await (const event of serve(options)) {
  event.respondWith(Response.redirect("https://deno.land", 303));
}
function serve(addr: string | HTTPOptions): Server;
§
serve(addr: string | HTTPOptions): Server
[src]

§Parameters

§
addr: string | HTTPOptions
[src]

§Return Type

§

Async iterable server instance for incoming events