Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/test_on_localhost/deps.ts>serve

Create a localhost server and run tests
Latest
function serve
import { serve } from "https://deno.land/x/test_on_localhost@0.2.2/deps.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

Returns

Server