I'm evaluating x402 for protecting routes that execute server-side logic, not just return static content.
app.use(
paymentMiddleware(
{
"GET /api/:id": {
accepts: {
scheme: "exact",
price: "$0.10",
network: "eip155:84532",
payTo: "0xMyAddress",
},
description: "Execute paid operation by ID",
},
},
resourceServer,
),
);
app.get("/api/:id", (req, res) => {
performOperation(req.params.id);
res.json({ result: "done" });
});
Is this a supported use case? The examples in the docs mostly show static content being served. I want to make sure the payment middleware is designed to work with dynamic parameterized routes that perform actual operations before I build on top of it.