open-standards/map/map-rs/crates/map-serve-axum/examples/serve_demo.rs
Transaction Science ba1212361f Add aac, map, sandbox standards; catalog the standards family
Commit the previously-untracked standard directories and catalog them in the
root README alongside proof:

- aac/    — communication cargo class: portable boards + a ten-level
            offline-first cascade (Apache-2.0 code / CC-BY-4.0 spec).
- map/    — geospatial cargo class: range-requestable signed tilesets +
            an F0–F4 fidelity cascade (Apache-2.0 code / CC-BY-4.0 spec).
- sandbox/— isolated, metered, attested execution across the heterogeneous
            compute fabric (Apache-2.0 code / CC-BY-4.0 spec).
- jouleclaw-otel-authz, jouleclaw-trust — new jouleclaw reference crates.

Root README now lists aac, map, sandbox, and proof in the catalog, the tree,
and the contribution guide.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-07 17:04:36 -04:00

20 lines
839 B
Rust

//! A runnable demo server: seeds one tile and serves it over HTTP.
//!
//! cargo run -p map-serve-axum --example serve_demo -- 127.0.0.1:8731
//! curl -i 'http://127.0.0.1:8731/tiles/auto/37.0/-122.0'
use map_index::cell_key;
use map_schema::{AltBand, Lod, Tier, TimeBucket};
use map_serve::MemoryStore;
#[tokio::main]
async fn main() -> std::io::Result<()> {
let addr = std::env::args().nth(1).unwrap_or_else(|| "127.0.0.1:8731".to_string());
let mut store = MemoryStore::default();
let cell = cell_key(37.0, -122.0, 14, AltBand(0), TimeBucket::ATEMPORAL, Lod(0));
store.insert(&cell, Tier::Base, b"hello-from-the-map-standard".to_vec(), "text/plain");
eprintln!("map-serve-axum listening on http://{addr} (try /tiles/auto/37.0/-122.0)");
map_serve_axum::run(&addr, store, "transaction.science").await
}