Skip to content

Abstract into a library #3

@2color

Description

@2color

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions