Kotaro Chikuba
Kotaro Chikuba
denon?
``` swdev serve --subdomain foo ``` ## Known problem Registered service worker exists after swdev serve. It will cause unexpected transform. So I think always use 7777 and change subdomain...
Add example by `swdev serve --allow-run` and `DenoProxy.exec("run", ["ls"]);` with xterm.js [xtermjs/xterm.js: A terminal for the web](https://github.com/xtermjs/xterm.js/)
```bash $ swdev serve # get ip and connected by others ``` ```ts // Fix next code. Use custom host and wss const socket = new WebSocket("ws://localhost:17777"); ```
Run client/swdev-worker.ts on [Deno Deploy](https://deno.com/deploy) depend on https://github.com/mizchi/swdev/issues/9 and https://github.com/mizchi/swdev/issues/7
Current one is fork of official [file_server](https://deno.land/manual/examples/file_server) ## Spec - Return `/__swdev_client.js` in memory - Return `/__swdev_worker.js` in memory - Rutern static content by request oak or another one. I...
client/swdev-worker.ts ```ts async function resolveContentByRequest(request: Request) { // rewrite adapater for custom backend. const res = await fetch(request); if (!res.ok) { throw new Error(`faild to fetch: ${request.url}`); } return res.text();...
Wait for serviceWorker ready for first setup. For example. ```ts navigator.serviceWorker.addEventListner("message", (ev) => { if (ev.data?.type === "ready") { run(...); } }) ```