Crate ogcapi_proxy

Crate ogcapi_proxy 

Source
Expand description

§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();
}

Structs§

CollectionProxy
Proxy for one individual OGC API Collection and its sub-endpoints.
CollectionsProxy
Proxy for multiple OGC API Collections

Functions§

routes
Get an Axum router serving the endpoints necessary to build a basic OGC API service. Construct a Router for a simple OGC API service.