Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/denjucks/src/deps/path/std/http/mod.ts>serve

Deno templating engine
Latest
function serve
import { serve } from "https://deno.land/x/denjucks@1.1.1/src/deps/path/std/http/mod.ts";

Create a HTTP server

import { serve } from "https://deno.land/std/http/server.ts";
const body = "Hello World\n";
const s = serve({ port: 8000 });
for await (const req of s) {
  req.respond({ body });
}

Parameters

addr: string | HTTPOptions