Skip to content

Dhruv-Varshney-developer/test-example-helia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

test-example-helia

Example for customizing fetch requests with custom headers using Trustless Gateway Block Broker

Prerequisites

  • Node.js version 22 or higher

Setup

  1. Clone this repository
  2. Run npm install
  3. Run node test.js

What this example demonstrates

This example shows how to use Helia's Trustless Gateway Block Broker to customize HTTP requests to IPFS gateways. Specifically, it demonstrates:

  • Adding custom headers (like User-Agent) to gateway requests
  • Using the transformRequestInit function to modify fetch parameters
  • Fetching content from IPFS using the customized gateway configuration

Expected output

When you run the test, you should see:

  • Helia initialization
  • Custom headers being applied during block fetching
  • Successful content retrieval from IPFS
  • Content details (length and preview)

Note

This is a standalone test repository to verify the example code that will be included in the official Helia documentation.

Links

About

Example for Trustless Gateway Block Broker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors