mirror of
https://github.com/nicoburns/blessed-rs
synced 2025-02-16 21:08:30 +00:00
Make index page redirect to rather than duplicate crates page
This commit is contained in:
parent
7a4b12dd7f
commit
caf1a1263b
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ use axum::{
|
||||||
routing::{get, post, get_service},
|
routing::{get, post, get_service},
|
||||||
Router,
|
Router,
|
||||||
http::StatusCode,
|
http::StatusCode,
|
||||||
|
response::Redirect,
|
||||||
};
|
};
|
||||||
use std::net::{SocketAddr, IpAddr};
|
use std::net::{SocketAddr, IpAddr};
|
||||||
use tower_http::{services::ServeDir, trace::TraceLayer};
|
use tower_http::{services::ServeDir, trace::TraceLayer};
|
||||||
|
@ -21,7 +22,7 @@ async fn main() {
|
||||||
|
|
||||||
// build our application with a route
|
// build our application with a route
|
||||||
let app = Router::new()
|
let app = Router::new()
|
||||||
.route("/", get(routes::crates::list::run))
|
.route("/", get(|| async { Redirect::to("/crates") }))
|
||||||
.route("/users", post(routes::users::create::run))
|
.route("/users", post(routes::users::create::run))
|
||||||
.route("/crates", get(routes::crates::list::run))
|
.route("/crates", get(routes::crates::list::run))
|
||||||
.nest("/static", static_file_service)
|
.nest("/static", static_file_service)
|
||||||
|
|
Loading…
Add table
Reference in a new issue