diff --git a/pslink/src/bin/pslink/main.rs b/pslink/src/bin/pslink/main.rs index 81172c0..f9220bb 100644 --- a/pslink/src/bin/pslink/main.rs +++ b/pslink/src/bin/pslink/main.rs @@ -166,7 +166,8 @@ pub async fn webservice( web::post().to(views::get_logged_user_json), ) .route("/login_user/", web::post().to(views::process_login_json)), - ), + ) + .default_service(web::to(views::to_admin)), ) // Serve the Wasm App for the admin interface. .service( diff --git a/pslink/src/bin/pslink/views.rs b/pslink/src/bin/pslink/views.rs index a1c0c4f..26ed848 100644 --- a/pslink/src/bin/pslink/views.rs +++ b/pslink/src/bin/pslink/views.rs @@ -308,6 +308,15 @@ pub async fn logout(id: Identity) -> Result { Ok(redirect_builder("/app/")) } +#[instrument()] +pub async fn to_admin() -> Result { + let response = HttpResponse::PermanentRedirect() + .set_header(actix_web::http::header::LOCATION, "/app/") + .body(r#"The admin interface moved to /app/"#); + + Ok(response) +} + #[instrument()] pub async fn redirect( config: web::Data,