feat: restructure project, implement askama templating #26

Merged
theo merged 21 commits from restructure-project into main 2024-07-26 14:42:03 +02:00
Showing only changes of commit ff2c84fb33 - Show all commits

View File

@ -1,9 +1,12 @@
use ::clego::get_router; use ::clego::get_router;
use std::path::Path; use std::path::Path;
use std::env;
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
let router = get_router(Path::new("/assets")); 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());
// TODO: select port based on available port (or ask in CLI) // TODO: select port based on available port (or ask in CLI)
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap(); let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();