This commit is contained in:
Joshua Perry 2024-06-06 19:25:03 +01:00
parent e620db1385
commit 3bec1e9d4c
2 changed files with 9 additions and 6 deletions

View File

@ -2,7 +2,14 @@ mod account;
mod db;
mod model;
pub fn router() -> axum::Router {
pub async fn run() {
let app = router();
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
axum::serve(listener, app).await.unwrap();
}
fn router() -> axum::Router {
axum::Router::new()
.nest("/account", account::router())
.nest("/predict", model::router())

View File

@ -1,8 +1,4 @@
#[tokio::main]
async fn main() {
let app = dermy_server::api::api_router();
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
axum::serve(listener, app).await.unwrap();
dermy_server::run().await;
}