Skip to content

Step-by-step setup support #175

Answered by sunli829
gudaoxuri asked this question in Q&A
Jan 22, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

You should do it like this:

let mut route = Route::new();

if let Some(ui_path) = &config.ui_path {
    route = route.nest(format!("/{}", ui_path), &serv.rapidoc());
}
 if let Some(spec_path) = &config.spec_path {
    route = route.at(format!("/{}", spec_path), poem::endpoint::make_sync(move |_| serv.spec().clone()));
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@gudaoxuri
Comment options

@auula
Comment options

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