Skip to content

Instantly share code, notes, and snippets.

@lucacasonato
Created July 18, 2020 12:34
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 lucacasonato/36e0d7e161745aa26b00e7c26080ed2e to your computer and use it in GitHub Desktop.
Save lucacasonato/36e0d7e161745aa26b00e7c26080ed2e to your computer and use it in GitHub Desktop.
Run oak in a worker

deno run -A --unstable ./main.ts

const worker = new Worker(new URL("./worker.ts", import.meta.url).href, { deno: true, type: "module" });
console.log("http://localhost:8000")
import { Application } from "https://deno.land/x/oak/mod.ts";
const app = new Application();
app.use((ctx) => {
ctx.response.body = "Hello World!";
});
await app.listen({ port: 8000 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment