Skip to content

Commit

Permalink
change default route
Browse files Browse the repository at this point in the history
  • Loading branch information
shouya committed Sep 18, 2024
1 parent a640f28 commit e45748e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 4 additions & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ impl ServerConfig {
app = app
.nest("/", inspector::router())
.nest("/_/", web::router())
.route(
"/",
get(|| async { axum::response::Redirect::temporary("/_/") }),
);
} else {
app = app.route("/", get(|| async { "rss-funnel is up and running!" }));
}
Expand Down
11 changes: 1 addition & 10 deletions src/server/inspector.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashMap;

use axum::extract::Query;
use axum::response::{IntoResponse, Redirect, Response};
use axum::response::{IntoResponse, Response};
use axum::Json;
use axum::{
routing::{get, post},
Expand Down Expand Up @@ -32,15 +32,6 @@ pub fn router() -> Router {
.route("/_inspector/config", get(config_handler))
.route("/_inspector/filter_schema", get(filter_schema_handler))
.route("/_inspector/preview", get(preview_handler))
.route("/", get(index_handler))
}

async fn index_handler(auth: Option<Auth>) -> impl IntoResponse {
if auth.is_some() {
Redirect::temporary("/_inspector/index.html")
} else {
Redirect::temporary("/_inspector/login.html")
}
}

async fn inspector_page_handler(_auth: Auth) -> impl IntoResponse {
Expand Down

0 comments on commit e45748e

Please sign in to comment.