refactor: restructure project

This commit is contained in:
Sandro Eiler 2023-12-30 22:21:57 +01:00
parent 699f8733e2
commit 89ea0995bb
9 changed files with 57 additions and 44 deletions

16
src/startup.rs Normal file
View file

@ -0,0 +1,16 @@
use axum::routing::IntoMakeService;
use axum::serve::Serve;
use axum::Router;
use tokio::net::TcpListener;
/// API routing
pub fn app() -> Router {
Router::new()
.merge(crate::routes::routes_health_check())
.merge(crate::routes::routes_subscriptions())
}
/// Start the server
pub fn run(listener: TcpListener) -> Serve<IntoMakeService<Router>, Router> {
axum::serve(listener, app().into_make_service())
}