Implement frontend routing and API fallback handling; add dependencies for include_dir and mime_guess
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
mod api;
|
||||
mod view;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use axum::{Extension, Router};
|
||||
@@ -25,6 +28,10 @@ pub struct AppService {
|
||||
pub fn get_root_router(state: impl Into<Arc<AppState>>) -> Router {
|
||||
let mut router = Router::new();
|
||||
|
||||
router = router
|
||||
.nest("/api", api::get_api_router())
|
||||
.merge(view::get_view_router());
|
||||
|
||||
router = middlewares::apply_root_middleware(router);
|
||||
|
||||
router = router.layer(Extension(state.into()));
|
||||
|
||||
Reference in New Issue
Block a user