Skip to content

Instantly share code, notes, and snippets.

@jesperbjensen
Created May 16, 2020 17:24
Show Gist options
  • Save jesperbjensen/e64875ccc35efbf0a905f11e3e533599 to your computer and use it in GitHub Desktop.
Save jesperbjensen/e64875ccc35efbf0a905f11e3e533599 to your computer and use it in GitHub Desktop.
import { serve } from "https://deno.land/std@0.50.0/http/server.ts";
const s = serve({ port: 8000 });
console.log("http://localhost:8000/");
let headers = new Headers();
headers.set("content-type", "text/html");
for await (const req of s) {
req.respond({
headers,
body: "<h1>Hello</h1>,
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment