Files
rustgames-catalog-server/src/router.rs

20 lines
433 B
Rust
Raw Normal View History

2025-11-13 02:52:18 +03:00
use axum::routing::{get, post};
pub mod funcs;
pub mod game;
use crate::app_state::AppState;
pub fn router(state: AppState) -> axum::Router {
axum::Router::new()
.route(
"/api/games",
get(funcs::games_list).post(funcs::insert_game),
)
.route(
"/api/games/{id}",
post(funcs::insert_game).delete(funcs::delete_game),
)
.with_state(state)
}