2024-07-24 21:59:24 +02:00
|
|
|
use ::app::get_router;
|
2024-07-25 09:21:17 +02:00
|
|
|
use std::env;
|
2024-07-23 20:08:45 +02:00
|
|
|
use std::path::Path;
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() {
|
2024-07-24 20:36:16 +02:00
|
|
|
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
|
|
let assets_path = Path::new(&manifest_dir).join("assets");
|
|
|
|
let router = get_router(assets_path.as_path());
|
2024-07-23 20:08:45 +02:00
|
|
|
|
|
|
|
// TODO: select port based on available port (or ask in CLI)
|
2024-08-02 23:33:48 +02:00
|
|
|
let listener = tokio::net::TcpListener::bind("localhost:3000").await.unwrap();
|
|
|
|
println!("Listening on: http://{}", listener.local_addr().unwrap());
|
2024-07-23 20:08:45 +02:00
|
|
|
axum::serve(listener, router).await.unwrap();
|
|
|
|
}
|