scalar_api_reference 0.2.2

Embed Scalar API documentation in Rust web applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use scalar_api_reference::warp::routes;
use serde_json::json;

#[tokio::main]
async fn main() {
    let config = json!({
        "url": "https://registry.scalar.com/@scalar/apis/galaxy?format=json",
        "theme": "kepler",
        "layout": "classic"
    });

    let scalar = routes("scalar", &config);

    println!("Server running on http://localhost:3030/scalar");
    warp::serve(scalar).run(([127, 0, 0, 1], 3030)).await;
}