redirect / to docs

This commit is contained in:
DSeeLP 2025-04-05 14:49:27 +02:00
parent 9d03f18fe7
commit c7a6e5d228

View File

@ -1,6 +1,6 @@
use std::{sync::Arc, time::Duration};
use axum::Router;
use axum::{Router, response::Redirect, routing::get};
use bankserver::{
Config,
api::{InteropState, Sockets},
@ -51,6 +51,7 @@ async fn main() {
});
let router = Router::new()
.route("/", get(redirect_docs))
.nest("/api", bankserver::api::router())
.merge(bankserver::api::interop_router())
.with_state(Arc::new(bankserver::api::AppState {
@ -71,6 +72,10 @@ async fn main() {
info!("Shutdown complete");
}
async fn redirect_docs() -> Redirect {
Redirect::permanent("/api/docs")
}
async fn shutdown_signal() {
let ctrl_c = async {
signal::ctrl_c()