Add a better structure in the project
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
use std::process::exit;
|
||||
|
||||
use axum::{Router, routing::get};
|
||||
use axum::Router;
|
||||
use dotenvy::dotenv;
|
||||
use tokio::signal;
|
||||
use tower_http::trace::TraceLayer;
|
||||
@@ -10,7 +10,8 @@ use tracing::{error, info};
|
||||
use tracing_subscriber::{EnvFilter, fmt, prelude::*};
|
||||
|
||||
mod config;
|
||||
mod health;
|
||||
mod handlers;
|
||||
mod routes;
|
||||
|
||||
use config::Config;
|
||||
|
||||
@@ -41,7 +42,8 @@ async fn main() {
|
||||
|
||||
// Build the Axum router
|
||||
let app = Router::new()
|
||||
.route("/health", get(health::health))
|
||||
// .nest("/health", routes::health::health::health_routes())
|
||||
.nest("/health", routes::health::health::health_routes())
|
||||
.layer(TraceLayer::new_for_http());
|
||||
|
||||
// Run the server
|
||||
|
||||
Reference in New Issue
Block a user