#![allow(clippy::unwrap_used, clippy::expect_used)]
use anyhow::Result;
use http_handle::Server;
use staticdatagen::compiler::service::compile;
use std::path::Path;
fn main() -> Result<()> {
let build_dir = Path::new("./examples/build");
let site_dir = Path::new("./examples/public");
let content_dir = Path::new("./examples/content/en");
let template_dir = Path::new("./examples/templates/en");
match compile(build_dir, content_dir, site_dir, template_dir) {
Ok(_) => println!(" ✅ Successfully compiled static site"),
Err(e) => println!(" ❌ Error compiling site: {:?}", e),
}
let example_root: String = site_dir.to_str().unwrap().to_string();
let server = Server::new("127.0.0.1:3000", example_root.as_str());
let _ = server.start();
Ok(())
}