Getting Started
Get up and running with Mocktioneer quickly.
Prerequisites
Before you begin, ensure you have:
- Rust (stable toolchain)
- Fastly CLI (optional, for Fastly adapter):
brew install fastly/tap/fastly - Wrangler (optional, for Cloudflare adapter):
npm install -g wrangler - WASM targets (for edge adapters):
- Fastly:
rustup target add wasm32-wasip1 - Cloudflare:
rustup target add wasm32-unknown-unknown
- Fastly:
Installation
Clone the Repository
git clone https://github.com/stackpop/mocktioneer.git
cd mocktioneerEdgeZero CLI (Optional)
The EdgeZero CLI provides a unified interface for all adapters, but it is maintained in the EdgeZero repository and isn't vendored here. If you already have it installed, you can use it; otherwise, skip this and use the direct adapter commands below.
If you have access to the EdgeZero repo:
cargo install --git https://github.com/stackpop/edgezero.git edgezero-cli --features cliOr run it from a local EdgeZero checkout:
cargo run --manifest-path /path/to/edgezero/Cargo.toml -p edgezero-cli --features cli -- --helpAlternatively, this repo vendors mocktioneer-cli (built on the EdgeZero CLI library) — no external install needed, and it adds the typed config commands:
cargo run -p mocktioneer-cli -- --help
# `mocktioneer.toml` is gitignored (created in Running Locally below); validate
# the committed template so this works on a fresh checkout.
cargo run -p mocktioneer-cli -- config validate --strict --app-config mocktioneer.toml.exampleRunning Locally
Seed the app config first. The OpenRTB (
/openrtb2/auction) and APS (/e/dtb/bid) endpoints readbid_cpmfrom the typed config via the fail-loudAppConfigextractor, so they error until you push the config once per adapter.mocktioneer.tomlis gitignored (per-env); create it from the committed template, then push:bashcp mocktioneer.toml.example mocktioneer.toml # then edit bid_cpm if desired cargo run -p mocktioneer-cli -- config push --adapter axum --yesThe root,
/static/*,/pixel, and/_/sizesendpoints work without it.
Option 1: Native Axum Server (Recommended for Development)
The fastest way to get started:
cargo run -p mocktioneer-adapter-axumThe server starts at http://127.0.0.1:8787.
Option 2: Using the CLI
edgezero-cli serve --adapter axum
# or, in-repo (no external install):
cargo run -p mocktioneer-cli -- serve --adapter axumOption 3: Fastly Local Development
edgezero-cli serve --adapter fastly
# Or directly:
fastly compute serve -C crates/mocktioneer-adapter-fastlyOption 4: Cloudflare Local Development
edgezero-cli serve --adapter cloudflare
# Or directly:
wrangler dev --config crates/mocktioneer-adapter-cloudflare/wrangler.tomlVerify Installation
Test the Root Endpoint
curl http://127.0.0.1:8787/You should see an HTML info page.
Test an OpenRTB Auction
curl -X POST http://127.0.0.1:8787/openrtb2/auction \
-H 'Content-Type: application/json' \
-d '{
"id": "test-request",
"imp": [{
"id": "imp-1",
"banner": {"w": 300, "h": 250}
}]
}' | jq .You should receive an OpenRTB bid response with a creative URL.
Test APS TAM Endpoint
curl -X POST http://127.0.0.1:8787/e/dtb/bid \
-H 'Content-Type: application/json' \
-d '{
"pubId": "1234",
"slots": [{
"slotID": "header",
"slotName": "header",
"sizes": [[728, 90]]
}]
}' | jq .Using Example Scripts
The examples/ directory contains helper scripts:
# OpenRTB auction
./examples/openrtb_request.sh
# APS TAM bid
./examples/aps_request.sh
# Fetch creative iframe
./examples/iframe_request.sh 300x250
# Test pixel endpoint
./examples/pixel_request.shOverride the host with MOCKTIONEER_BASE_URL:
MOCKTIONEER_BASE_URL=https://mocktioneer.edgecompute.app ./examples/openrtb_request.shRun Tests
cargo testNext Steps
- Learn about configuration options
- Understand the architecture
- Explore adapter-specific deployment
- Check the API reference for all endpoints