refactor: restructure project
This commit is contained in:
parent
699f8733e2
commit
89ea0995bb
9 changed files with 57 additions and 44 deletions
16
src/startup.rs
Normal file
16
src/startup.rs
Normal 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())
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue