Current state
This repo contains a static next.js app and demonstrates two things:
- service worker bundling and registration such that app rendering is blocked until registered
- Service worker code which is intercept gateway requests
Idea for how this could be abstracted into a library or verified fetch
Service worker
For usage in service workers, we could export the following
import { initIpfsSWHandler } from '@helia/gateway-handler'
const ipfsPathHandler = initIpfsPathHandler({
// gateways: [...]
// routers: [...]
})
self.addEventListener('fetch', ipfsPathHandler)
Current state
This repo contains a static next.js app and demonstrates two things:
Idea for how this could be abstracted into a library or verified fetch
Service worker
For usage in service workers, we could export the following