A gateway service that provides easy access to WVM Network bundles with automatic content-type detection and hex processing.
- Fetches bundle data from bundler.wvm.network
- Automatic content-type detection for common file types (PDF, JPEG, PNG, text)
- Hex input processing
- CORS enabled
- Vercel deployment ready
npm install
Start the development server:
npm start
GET /bundle/:txHash/:index
txHash
: The transaction hash of the bundleindex
: The index of the envelope within the bundle (zero-based)
The response will include the processed content with the appropriate content-type header. The service automatically detects and sets the content type based on:
- Content-Type tag in the envelope (if present)
- File signatures (PDF, JPEG, PNG)
- Text content detection
- Defaults to
application/octet-stream
for unknown types
curl http://localhost:3001/bundle/0xf4aa3cc6580d1ecbc93a9c015087718bee67290a6cf14587bbae7ef69e8e65fe/0
Content-Type
: Automatically detected content typeContent-Length
: Size of the content in bytesCache-Control
: public, max-age=31536000 (1 year)
The API returns appropriate HTTP status codes and error messages:
400
: Invalid parameters or input data404
: Envelope not found500
: Internal server error- Status codes from bundler.wvm.network are passed through
This project is configured for deployment on Vercel. To deploy:
- Install Vercel CLI:
npm install -g vercel
- Deploy:
vercel
The included vercel.json
configuration handles all routing and build settings.