Skip to content

Commit

Permalink
fix base route
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 28, 2024
1 parent b29067c commit e7fd26d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ async fn rocket() -> _ {

sqlx::migrate!().run(&app.db).await.expect("Failed to apply migrations :(");

let base_route = if cfg!(debug_assertions) { "/backend/" } else { "/" };

rocket::build()
.manage(app)
.mount("/backend/", routes![discord_login, discord_logout, discord_callback, minecraft_username_change, get_user_info, username_to_uuid_minecraft, id_to_username_minecraft, id_to_username_discord])
.mount(base_route, routes![discord_login, discord_logout, discord_callback, minecraft_username_change, get_user_info, username_to_uuid_minecraft, id_to_username_minecraft, id_to_username_discord])
.attach(AdHoc::on_ignite("OAuth Config", |rocket| async {
let config = OAuthConfig::new(
StaticProvider::Discord,
Expand Down

0 comments on commit e7fd26d

Please sign in to comment.