Updated deps.

Health and root endpoint
This commit is contained in:
Martin Berg Alstad
2024-09-07 22:26:52 +02:00
parent 5d5e6393ac
commit 8e728cca58
4 changed files with 47 additions and 24 deletions

View File

@ -39,6 +39,7 @@ where
let auth_layer = AuthManagerLayerBuilder::new(user_service.clone(), session_layer).build();
AppBuilder::new()
.routes([
routes::router(),
routes::hotel::router()
.with_state(pool.clone())
.login_required::<Pool>(),

View File

@ -1,6 +1,25 @@
use lib::{router, routes};
pub mod auth;
pub mod hotel;
pub mod reservation;
pub mod room;
pub mod task;
pub mod user;
router! {
"/",
routes! {
get "/" => home,
get "/health" => health,
}
}
async fn home() -> &'static str {
"Hello, World!" // TODO inform the user about the API
}
/// Health check endpoint
async fn health() -> &'static str {
"OK"
}