A sandbox for your HTTP clients.

Store webhook payloads, inspect what your client sends, and exercise error handling. Open the HTTP test lab in the console for ready-to-run scenarios and a response inspector.

Only /secure/* endpoints require X-API-Key. Public CRUD, health, telemetry, the UI, docs, and HTTP lab routes do not require a key. Set a strong API_KEY before sharing the server. Use synthetic test data.

Payload storage

Replace {scope} with public or secure. Only requests in the secure scope require the API key in X-API-Key. Item IDs only resolve in their own scope. Any valid JSON value is supported, including arrays, strings, numbers, booleans, and null. An empty request body stores null.

MethodPathResult
GET/{scope}/items200 · array, newest first
POST/{scope}/items201 · stored item
GET/{scope}/items/{id}200 · item, or 404
PUT/{scope}/items/{id}200 · replace the entire payload
DELETE/{scope}/items/{id}200 · delete one item
DELETE/{scope}/items200 · clear the scope and return removed count
{"id":1,"payload":{"event":"demo"},"scope":"public","created_at":"2026-10-11 12:00:00"}

Malformed JSON returns 400. Missing or incorrect API keys return 401. Unsupported storage methods return 405 with an Allow header.

HTTP test lab

Lab requests do not create database records. GET endpoints also support HEAD. OPTIONS returns a CORS preflight response.

PathBehavior
/lab/echoGET, HEAD, POST, PUT, PATCH, DELETE. Echo method, path, repeated query values, headers, raw body, parsed JSON, and byte count. Body limit: 1 MiB (413 above it). Authorization, Proxy-Authorization, Cookie, and X-API-Key values are redacted.
/lab/status/{code}Choose any integer from 200–599. 204, 205, and 304 have no body. 429 includes Retry-After: 5. Other statuses return status and message.
/lab/delay/{ms}Delay 0–10000 milliseconds. Cancelled requests stop the timer. Response: delay_ms and status.
/lab/redirect?to=/lab/echo&code=307Choose 301, 302, 303, 307, or 308. Defaults: /lab/echo and 302. Only local paths are allowed. The console follows redirects and shows the final URL/status.
/lab/cacheReturns ETag: "small-server-v1" and Cache-Control: public, max-age=60. A matching If-None-Match (including weak tags or *) returns 304.

Invalid status, delay, or redirect parameters return 400. /health reports availability; /stats reports request counters, latency, and item counts. Telemetry resets on restart and includes console polling.

Use API from the console

Choose Use API to browse the endpoint catalog from /openapi.json, inspect the complete URL, copy the URL, or copy a JavaScript or cURL request. Snippets include the selected route and item ID, a JSON sample body, or the filename and raw File body for uploads. The deployed base URL is https://small-server.fly.dev; local development uses http://localhost:8795.

Public routes can be called from frontend JavaScript. Anyone who can reach this server can also read and change data in /public/*, so treat public-scope data as public. Keep /secure/* calls in a backend or server-side proxy:

// Browser: public data only
const response = await fetch("https://small-server.fly.dev/public/items");
const items = await response.json();

// Server-side JavaScript: private route
const secureResponse = await fetch("https://small-server.fly.dev/secure/items", {
  headers: { "X-API-Key": process.env.SMALL_SERVER_API_KEY }
});

Never bundle SMALL_SERVER_API_KEY into React or other browser JavaScript. R2 access keys and secret keys must also stay server-side. Copy the selected endpoint URL or its ready-to-copy snippet in the console; for a raw upload, enter a local filename; the Node.js snippet reads its bytes with the filename as a query parameter, not multipart data.

Browser CORS

The server allows Access-Control-Allow-Origin: *, methods GET, HEAD, POST, PUT, PATCH, DELETE, and OPTIONS, and request headers Content-Type, X-API-Key, If-None-Match, X-Test-Id, and Idempotency-Key. Browser code can read the response headers ETag, Location, Retry-After, Content-Disposition, Content-Length, Cache-Control, and Idempotency-Replayed.

A JSON content type or custom request header can trigger a browser preflight. This example checks the public items route:

curl -i -X OPTIONS 'https://small-server.fly.dev/public/items' \
  -H 'Origin: https://your-app.example' \
  -H 'Access-Control-Request-Method: POST' \
  -H 'Access-Control-Request-Headers: content-type,x-test-id'

Wildcard origins do not support cookie-based credentials: "include". Do not use mode: "no-cors"; the browser hides the response from JavaScript. Native and mobile apps and backend clients are not restricted by browser CORS. Do not send the private API key from browser code.

Private Cloudflare R2 uploads

R2 is optional. Only /secure/* upload routes require X-API-Key. Create an R2 bucket and an API token with Object Read & Write permission scoped to the bucket. Keep the bucket private: access is server-side, so a public bucket or bucket CORS configuration is not needed. Cloudflare shows the secret access key once; save the ID and secret in the ignored local .env.r2 file. See Cloudflare token setup.

R2_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
R2_BUCKET=your-bucket-name
R2_ACCESS_KEY_ID=your-access-key-id
R2_SECRET_ACCESS_KEY=your-secret-access-key

For jurisdictional buckets, use the matching endpoint, for example https://<account-id>.eu.r2.cloudflarestorage.com, https://<account-id>.us.r2.cloudflarestorage.com, or https://<account-id>.fedramp.r2.cloudflarestorage.com. Locally load .env.r2 before starting the server. On Fly, import .env.fly and .env.r2 from the repository root with fly secrets import < .env.fly and fly secrets import < .env.r2, then deploy with fly deploy -a small-server.

Filename must start with an ASCII letter or digit and may then contain only ASCII letters, digits, dot, underscore, or hyphen (maximum 128 characters). The browser UI normalizes selected filenames to this allowed format; API callers must send a valid name. The app generates a random 32-character lowercase hex prefix plus a hyphen. Listing cursors are opaque and limited to 2048 bytes. Files outside the app's uploads/ prefix cannot be accessed. At most four uploads can run concurrently; an extra upload returns 429 with Retry-After: 1. R2 unconfigured returns 503, bad inputs 400, oversized uploads 413, missing downloads 404, and S3 failures a generic 502.

curl -X POST 'https://small-server.fly.dev/secure/uploads?filename=example.txt' \
  -H 'X-API-Key: YOUR-API-KEY' -H 'Content-Type: application/octet-stream' \
  --data-binary @example.txt

curl 'https://small-server.fly.dev/secure/uploads' -H 'X-API-Key: YOUR-API-KEY'
curl -OJ 'https://small-server.fly.dev/secure/uploads/0123456789abcdef0123456789abcdef-example.txt' \
  -H 'X-API-Key: YOUR-API-KEY'
curl -X DELETE 'https://small-server.fly.dev/secure/uploads/0123456789abcdef0123456789abcdef-example.txt' \
  -H 'X-API-Key: YOUR-API-KEY'

R2 Standard currently includes 10 GB-month of storage, 1 million Class A operations, and 10 million Class B operations each month. Additional R2 usage is billed by Cloudflare separately from Fly. Check current R2 pricing.

Try these test recipes

curl -X POST 'http://localhost:8795/lab/echo?tag=one&tag=two' \
  -H "Content-Type: application/json" -H "X-Test-Id: demo" \
  -d '{"event":"order.created"}'

curl -i http://localhost:8795/lab/status/429
curl --max-time 1 http://localhost:8795/lab/delay/2000
curl -i http://localhost:8795/lab/cache \
  -H 'If-None-Match: "small-server-v1"'
curl -i http://localhost:8795/secure/items -H "X-API-Key: YOUR-API-KEY"

In the console, load a scenario, set an expected status, and send. PASS/FAIL checks the final HTTP status only. For redirects, use curl without -L to inspect the initial Location header. Custom request headers use a JSON object of string values; the browser controls restricted headers such as Host and Cookie.

History keeps the last 20 requests in memory and disappears on reload. Selecting a history entry loads it for review; press Send to execute. API keys are held in memory. Copy response exports the response currently shown.

CI and deployment

The GitHub Actions runs start for pull requests, pushes to main, and manual dispatch. They check Go formatting, tests, vet, build, and node --test ui_test.cjs. Deployment runs only for a push to main or a manual run after those checks pass.

Fly deployment uses the app-scoped Fly token stored as the GitHub Actions secret FLY_API_TOKEN, Fly CI action version v0.4.115, remote build, one-machine mode, and a post-deploy health smoke check. In-progress deployments are not canceled by a newer run. The token expires after one year; replace the FLY_API_TOKEN GitHub secret before it expires.

Run and verify

go run .
go test ./...
go vet ./...
go build .

Configuration: PORT=8795, DB_PATH=./data.db, and API_KEY. Changes to the embedded console, guide, or OpenAPI require restarting go run or rebuilding the binary. The README covers Windows, Docker, and Fly deployment. Import the repository's Postman collection to use the same lab outside the browser.

Claire workflow test gateways

The five authenticated POST endpoints under /secure/gateways/ are crm, calendar, business, database, and voice. Select them in Use API for examples and supported operations. They match the Claire integration blocks from the T3 thread. These are mocks using shared synthetic data persisted in SQLite; no real CRM, calendar, business tool, external database, AI, or audio service is called. CRM returns root id; calendar returns event_id; voice uses analysis. Preserve Idempotency-Key across retries: successful responses replay after restart, changed input with the same key returns 409. Body/record limit: 64 KiB; dataset limit: 1000 records. Database updates/deletes require filters; overlapping bookings return 409.

Copy examples · Full operations · Postman collection