Skip to content

Instantly share code, notes, and snippets.

@rashid2003
Created June 30, 2022 02:06
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 rashid2003/9a9b4e1eca0e2a918e837454f94d8157 to your computer and use it in GitHub Desktop.
Save rashid2003/9a9b4e1eca0e2a918e837454f94d8157 to your computer and use it in GitHub Desktop.
import { serve } from "https://deno.land/std@0.145.0/http/server.ts";
const port = 8080;
const handler = (request: Request): Response => {
const body = 'Hello World\n';
return new Response(body, { status: 200 });
};
console.log(`HTTP webserver running. Access it at: http://localhost:8080/`);
await serve(handler, { port });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment