We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I will close this as completed as the original problem is now fixed, but my second question still stands:
Is is possible to provide a custom HTML template to set things like the page title and icon for those UIs (Specifically the swagger one in my case)?
Originally posted by @SaculRennorb in #660 (comment)
The text was updated successfully, but these errors were encountered:
Hey, I just went ahead and implemented my own version using the original source code, which was easy enough.
Here are some of the rough ideas:
fn create_endpoint(spec : &str) -> impl Endpoint { let ui_html = String::from(swagger_ui::HTML_INDEX).replace("{spec}", spec); poem::Route::new() .at("/" , make_sync(move |_| Html(ui_html.clone()))) .at("/oauth2.html", make_sync(move |_| Html(swagger_ui::HTML_OAUTH2))) } ... let api_service = OpenApiService::new(...); let api_ep = api_service .with(poem::middleware::Cors::new()) ... ; let ui_ep = create_endpoint(&api_service.spec()); let route = Route::new() .nest("/", api_ep) .nest("/ui", ui_ep) ;
the HTML_... consts are just the desired custom html build into the binary with str_include!(...).
HTML_...
str_include!(...)
Sorry, something went wrong.
cool. good one. im looking into that. thanks
No branches or pull requests
Originally posted by @SaculRennorb in #660 (comment)
The text was updated successfully, but these errors were encountered: