x402 Stellar Express
Express middleware for protecting routes with x402 payments.
Installation
npm install x402-stellar-express expressUsage
import express from "express";
import { paymentMiddleware } from "x402-stellar-express";
const app = express();
app.use(paymentMiddleware({
payTo: "GXXXX...", // Your Stellar address
routes: {
"/api/premium/*": { price: "1.00" }
},
facilitator: { url: "http://localhost:4022" }
}));
app.listen(3000);