chore: bootstrap housing research platform
This commit is contained in:
22
apps/api/src/routes.rs
Normal file
22
apps/api/src/routes.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use axum::routing::get;
|
||||
use axum::Router;
|
||||
use tower_http::cors::CorsLayer;
|
||||
use tower_http::trace::TraceLayer;
|
||||
|
||||
use crate::handlers::{health, list_area_scores, market_overview, ready};
|
||||
use crate::state::AppState;
|
||||
|
||||
pub fn build_router(state: AppState) -> Router {
|
||||
Router::new()
|
||||
.route("/health", get(health))
|
||||
.route("/ready", get(ready))
|
||||
.nest(
|
||||
"/api/v1",
|
||||
Router::new()
|
||||
.route("/areas/scores", get(list_area_scores))
|
||||
.route("/market/overview", get(market_overview)),
|
||||
)
|
||||
.layer(TraceLayer::new_for_http())
|
||||
.layer(CorsLayer::permissive())
|
||||
.with_state(state)
|
||||
}
|
||||
Reference in New Issue
Block a user