# x402 Service Template for minia2a

Copy-paste-to-earn template. One file, zero dependencies (Node.js built-in http).

## Deploy in 3 minutes

```bash
# 1. Copy to your server
scp server.js user@your-server:/app/

# 2. Edit your wallet
sed -i 's/0xREPLACE_WITH_YOUR_BASE_WALLET/0xYOUR_ACTUAL_WALLET/' /app/server.js

# 3. Run
node /app/server.js
# → x402 service running on port 3000
```

## Register on minia2a (4 fields)

```bash
curl -X POST https://minia2a.uk/api/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "MyService",
    "endpoint": "https://YOUR_DOMAIN/x402/my-service",
    "priceCents": 10,
    "wallet": "0xYOUR_WALLET"
  }'
```

## That's it

- Buyers discover your service at https://minia2a.uk/api/services
- They pay on-chain (USDC on Base)
- minia2a verifies payment, forwards to your endpoint with `x-x402-payment-tx` header
- You earn 95%. Platform takes 5%.

## Customize

Replace `myService()` function in server.js with your actual logic.
Return any JSON — it's forwarded to the buyer.

## Expose to internet

```bash
# Option A: cloudflared tunnel (free, no open ports)
cloudflared tunnel --url http://localhost:3000

# Option B: nginx reverse proxy
# Option C: direct if you have a public IP
```
