2024-07-23 20:08:45 +02:00
|
|
|
use ::clego::get_router;
|
|
|
|
use std::path::Path;
|
2024-07-24 20:36:16 +02:00
|
|
|
use std::env;
|
2024-07-23 20:08:45 +02:00
|
|
|
|
|
|
|
#[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)
|
|
|
|
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
|
|
|
|
axum::serve(listener, router).await.unwrap();
|
|
|
|
}
|