Skip to content

Commit

Permalink
Merge pull request #25 from wbcsd/martin/redirect-to-swagger
Browse files Browse the repository at this point in the history
feat: rediret "/" to swagger ui
  • Loading branch information
zeitgeist authored Apr 2, 2024
2 parents e9cba91 + 1218208 commit 19f7cb5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions endpoint/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,11 @@ fn post_event_fallback() -> EventsApiResponse {
EventsApiResponse::NoAuth(error::AccessDenied::default())
}

#[get("/")]
fn index() -> rocket::response::Redirect {
rocket::response::Redirect::to("/swagger-ui/")
}

#[catch(400)]
fn bad_request() -> error::BadRequest {
Default::default()
Expand All @@ -460,6 +465,7 @@ fn create_server(key_pair: KeyPair) -> rocket::Rocket<rocket::Build> {

rocket::build()
.mount("/", openapi_routes)
.mount("/", routes![index])
.mount("/", routes![get_list, get_pcf_unauth, post_event_fallback])
.mount("/", routes![openid_configuration, jwks])
.mount("/2/auth", routes![oauth2_create_token])
Expand Down

0 comments on commit 19f7cb5

Please sign in to comment.