Skip to content
Discussion options

You must be logged in to vote

Try this and access http://127.0.0.1:7887/swagger-ui/:

fn router(config: &Config) -> Router {

    let router = Router::new()
        .hoop(Logger::default())
        .get(health::get_health)
        .push(Router::with_path("health").get(health::get_health))
        .push(Router::with_path("version").get(version::get_version));

    let doc = OpenApi::new("TEST API", "0.0.1").merge_router(&router);

    let router = router
        .push(doc.into_router("/api-doc/openapi.json"))
        .push(SwaggerUi::new("/api-doc/openapi.json").into_router("/swagger-ui"));
    router
}

Replies: 5 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@josejachuf
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@josejachuf
Comment options

Answer selected by josejachuf
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@josejachuf
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants