A minimal x402-protected Express server that accepts ICP micropayments using @canister-software/x402-icp.
Clone the repo and install dependencies:
npm installCreate a .env file:
FACILITATOR_URL=https://facilitator.canister.software
PAYTO_PRINCIPAL=your-icp-principal-here
npm run start| Route | Protection | Price |
|---|---|---|
GET /api/data |
x402 | 100000 e8s (0.001 TESTICP) |
GET /health |
None | Free |