chore: mount API at /0.8/ as well
This commit is contained in:
@@ -75,7 +75,15 @@ pub async fn web() -> Rocket<Build> {
|
|||||||
// Configure Swagger
|
// Configure Swagger
|
||||||
let swagger = revolt_rocket_okapi::swagger_ui::make_swagger_ui(
|
let swagger = revolt_rocket_okapi::swagger_ui::make_swagger_ui(
|
||||||
&revolt_rocket_okapi::swagger_ui::SwaggerUIConfig {
|
&revolt_rocket_okapi::swagger_ui::SwaggerUIConfig {
|
||||||
url: "../openapi.json".to_owned(),
|
url: "/openapi.json".to_owned(),
|
||||||
|
..Default::default()
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.into();
|
||||||
|
|
||||||
|
let swagger_0_8 = revolt_rocket_okapi::swagger_ui::make_swagger_ui(
|
||||||
|
&revolt_rocket_okapi::swagger_ui::SwaggerUIConfig {
|
||||||
|
url: "/0.8/openapi.json".to_owned(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -120,6 +128,7 @@ pub async fn web() -> Rocket<Build> {
|
|||||||
.mount("/", rocket_cors::catch_all_options_routes())
|
.mount("/", rocket_cors::catch_all_options_routes())
|
||||||
.mount("/", util::ratelimiter::routes())
|
.mount("/", util::ratelimiter::routes())
|
||||||
.mount("/swagger/", swagger)
|
.mount("/swagger/", swagger)
|
||||||
|
.mount("/0.8/swagger/", swagger_0_8)
|
||||||
.manage(authifier)
|
.manage(authifier)
|
||||||
.manage(db)
|
.manage(db)
|
||||||
.manage(amqp)
|
.manage(amqp)
|
||||||
|
|||||||
@@ -61,6 +61,47 @@ pub fn mount(config: Settings, mut rocket: Rocket<Build>) -> Rocket<Build> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.features.webhooks_enabled {
|
||||||
|
mount_endpoints_and_merged_docs! {
|
||||||
|
rocket, "/0.8".to_owned(), settings,
|
||||||
|
"/" => (vec![], custom_openapi_spec()),
|
||||||
|
"" => openapi_get_routes_spec![root::root],
|
||||||
|
"/users" => users::routes(),
|
||||||
|
"/bots" => bots::routes(),
|
||||||
|
"/channels" => channels::routes(),
|
||||||
|
"/servers" => servers::routes(),
|
||||||
|
"/invites" => invites::routes(),
|
||||||
|
"/custom" => customisation::routes(),
|
||||||
|
"/safety" => safety::routes(),
|
||||||
|
"/auth/account" => rocket_authifier::routes::account::routes(),
|
||||||
|
"/auth/session" => rocket_authifier::routes::session::routes(),
|
||||||
|
"/auth/mfa" => rocket_authifier::routes::mfa::routes(),
|
||||||
|
"/onboard" => onboard::routes(),
|
||||||
|
"/push" => push::routes(),
|
||||||
|
"/sync" => sync::routes(),
|
||||||
|
"/webhooks" => webhooks::routes()
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
mount_endpoints_and_merged_docs! {
|
||||||
|
rocket, "/0.8".to_owned(), settings,
|
||||||
|
"/" => (vec![], custom_openapi_spec()),
|
||||||
|
"" => openapi_get_routes_spec![root::root],
|
||||||
|
"/users" => users::routes(),
|
||||||
|
"/bots" => bots::routes(),
|
||||||
|
"/channels" => channels::routes(),
|
||||||
|
"/servers" => servers::routes(),
|
||||||
|
"/invites" => invites::routes(),
|
||||||
|
"/custom" => customisation::routes(),
|
||||||
|
"/safety" => safety::routes(),
|
||||||
|
"/auth/account" => rocket_authifier::routes::account::routes(),
|
||||||
|
"/auth/session" => rocket_authifier::routes::session::routes(),
|
||||||
|
"/auth/mfa" => rocket_authifier::routes::mfa::routes(),
|
||||||
|
"/onboard" => onboard::routes(),
|
||||||
|
"/push" => push::routes(),
|
||||||
|
"/sync" => sync::routes()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
rocket
|
rocket
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user