deno run -A --unstable ./main.ts
Created
July 18, 2020 12:34
-
-
Save lucacasonato/36e0d7e161745aa26b00e7c26080ed2e to your computer and use it in GitHub Desktop.
Run oak in a worker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const worker = new Worker(new URL("./worker.ts", import.meta.url).href, { deno: true, type: "module" }); | |
console.log("http://localhost:8000") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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