mirror of
https://git.dirksys.ovh/dirk/bankserver.git
synced 2025-12-20 02:59:20 +01:00
redirect / to docs
This commit is contained in:
parent
9d03f18fe7
commit
c7a6e5d228
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user