Skip to content

Instantly share code, notes, and snippets.

@koumaza
Last active May 26, 2021 18:26
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 koumaza/30484d01c7029b8b416ff3a2b670587e to your computer and use it in GitHub Desktop.
Save koumaza/30484d01c7029b8b416ff3a2b670587e to your computer and use it in GitHub Desktop.
/*
deno run --allow-read=$PWD --allow-net=0.0.0.0 server.ts
*/
import { Application, send } from "https://deno.land/x/oak@v7.5.0/mod.ts";
const app = new Application();
app.use(async (context) => {
await send(context, context.request.url.pathname, {
root: `${Deno.cwd()}/`,
index: "index.html",
});
});
console.log(`Started Deno Server 🌳🌳\nOn "${Deno.cwd()}/src"`)
await app.listen({ port: 8100 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment