ogcapi-proxy 0.1.1

OGC API proxy service
Documentation

ogcapi-proxy

This crate provides Tower Services for proxying OGC API Collections.

Status

This is still in early development, is not production ready and will have frequent breaking changes.

Example

use ogcapi_proxy::{CollectionsProxy, routes};

#[tokio::main]
async fn main() {
    let collections_proxy = CollectionsProxy::from(vec![
        (
            "proxied_lakes".to_string(),
            "https://demo.pygeoapi.io/stable/collections/lakes".to_string(),
        ),
        (
            "proxied_dutch_windmills_id".to_string(),
            "https://demo.pygeoapi.io/stable/collections/dutch_windmills".to_string(),
        ),
    ]);

    let router = routes(collections_proxy).await;

    let listener = tokio::net::TcpListener::bind("127.0.0.1:3000")
        .await
        .unwrap();
    println!("listening on {}", listener.local_addr().unwrap());
    axum::serve(listener, router).await.unwrap();
}