Split the code into files

This commit is contained in:
2025-11-13 02:52:18 +03:00
parent 86d7545f7c
commit 96a416b010
6 changed files with 149 additions and 130 deletions

19
src/router.rs Normal file
View File

@ -0,0 +1,19 @@
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)
}