Express
Price Express routes.
Pre-release · planned API
In development
This adapter is being implemented against the core v2 contract. The example below shows the intended shape and may change.
import express from "express";
import { tollstile } from "@tollstile/express";
import { toll } from "./toll";
const app = express();
app.post("/v1/generate", tollstile(toll.price("$0.04")), async (req, res) => {
const payment = req.payment;
res.json(await generate(req.body));
});