mix mpp.demo (mpp v0.6.2)

Copy Markdown View Source

Starts a local HTTP server demonstrating the full MPP 402 payment flow.

No real payment credentials needed — a magic "demo-token" payload succeeds.

mix mpp.demo
mix mpp.demo --port 8080

Options

  • --port — port to listen on (default: 4402)

What It Does

  1. Starts a Bandit server with MPP.Demo.Router
  2. GET /resource returns a 402 challenge with WWW-Authenticate: Payment
  3. Retry with Authorization: Payment <credential> to get a 200 with Payment-Receipt
  4. The startup banner includes copy-paste curl commands

Requirements

Bandit must be available (it's a :dev dependency of mpp). If you're using mpp as a library dependency, add {:bandit, "~> 1.10", only: :dev} to your deps.