This is a experiment to replace wrangler preview --watch
with Deno.
This idea is based on that Deno has the same api as Service Workers:
That would be harder using Node, cause would need polyfill for all those objects.
Create a entry file entry.deno.ts
that imports deno-server followed by Cloudflare Worker entry file.
import "server.deno.js"
import "./entry.worker.ts"
And run using denon to watch for file changes:
denon run --allow-net entry.deno.ts
- Configure PORT
- bin script to run against
entry.worker.ts
- Make typescript version work