npm.io
1.0.0 • Published 1 year ago

express-ipld

Licence
MIT
Version
1.0.0
Deps
2
Size
4 kB
Vulns
0
Weekly
0
Stars
1

express-ipld

Express middleware for dag-json and dag-cbor IPLD codecs.

Usage:

import express from "express";
import ipld from "express-ipld";

const app = express();

app.use(
	ipld({
		type: ["application/json", "application/cbor"],
	}),
);

app.post("/", (req, res) => {
	// if request has content-type application/json or application/cbor,
	// req.body will be parsed using dag-json / dag-cbor
	// ...
});

Keywords