Konubinix' opinionated web of thoughts

Simulate Http Server Using Service Workers

Fleeting

simulate http server using service workers

Very practical when providing wasm functionalities while keeping an homogeneous development environment, using http (fetch) communication everywhere.

Open this page and enable the inspector (F12) to see how fetching behaves.

// fetching a real document
r = await fetch("index.html")
await r.text()

// fetching some data that actually is generated by something like a wasm program
r = await fetch("dummy/something")
await r.json()

https://konubinix.eu/ipfs/bafybeiauqq7kvea4mj6jwh2c55v5rzlocoaivbw667fxz2l5qblo3sllzy

See how I can fetch a page normally but still catch dummy pages and return my own kind of responses?