Skip to content

Instantly share code, notes, and snippets.

@napolux
Created June 11, 2020 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save napolux/b27556ae0b17c43111190ae2388da4fb to your computer and use it in GitHub Desktop.
Save napolux/b27556ae0b17c43111190ae2388da4fb to your computer and use it in GitHub Desktop.
Deno server example
import { serve } from "https://deno.land/std@0.56.0/http/server.ts";
const PORT = 8000;
const s = serve({ port: PORT });
console.log(`Listening @ http://localhost:${PORT}`);
for await (const req of s) {
req.respond({ body: "Hello World\n" });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment