3.0.3 • Published 22 days ago

@helia/delegated-routing-v1-http-api-server v3.0.3

Weekly downloads
-
License
Apache-2.0 OR MIT
Repository
github
Last release
22 days ago

ipfs.tech Discuss codecov CI

A Delegated Routing V1 HTTP API server powered by Helia

About

Implements HTTP routes for a Fastify server that conform to the Routing V1 HTTP API.

Example

import { createHelia } from 'helia'
import { createDelegatedRoutingV1HttpApiServer } from '@helia/delegated-routing-v1-http-api-server'

const helia = await createHelia()
const server = await createDelegatedRoutingV1HttpApiServer(helia, {
  listen: {
    // fastify listen options
  }
})

// now make http requests

Alternatively if you have a Fastify instance already you can add routes to it.

Example

import fastify from 'fastify'
import cors from '@fastify/cors'
import { createHelia } from 'helia'
import routes from '@helia/routing-v1-http-api-server/routes'

const server = fastify({
 // fastify options
})
await server.register(cors, {
  origin: '*',
  methods: ['GET', 'OPTIONS'],
  strictPreflight: false
})

const helia = await createHelia()

// configure Routing V1 HTTP API routes
routes(server, helia)

await server.listen({
  // fastify listen options
})

// now make http requests
3.0.3

22 days ago

3.0.2

3 months ago

3.0.1

3 months ago

3.0.0

4 months ago

2.0.1

4 months ago

2.0.0

4 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago

0.0.0

6 months ago