|
|
|
@ -25,9 +25,13 @@ pub fn default_false() -> bool {
|
|
|
|
|
|
|
|
|
|
#[actix_web::main]
|
|
|
|
|
async fn main() -> std::io::Result<()> {
|
|
|
|
|
// parse command line arguments
|
|
|
|
|
let options = Options::init();
|
|
|
|
|
|
|
|
|
|
// start logger
|
|
|
|
|
rag::init().unwrap();
|
|
|
|
|
|
|
|
|
|
// load templates
|
|
|
|
|
let mut handlebars = Handlebars::new();
|
|
|
|
|
handlebars.register_templates_directory(".html", "./templates").unwrap();
|
|
|
|
|
let handlebars_ref = web::Data::new(handlebars);
|
|
|
|
@ -35,6 +39,7 @@ async fn main() -> std::io::Result<()> {
|
|
|
|
|
info!("Configuration (see --help to change):");
|
|
|
|
|
info!("{:?}", options);
|
|
|
|
|
|
|
|
|
|
// setup and start http server
|
|
|
|
|
HttpServer::new(move || {
|
|
|
|
|
App::new()
|
|
|
|
|
.app_data(handlebars_ref.clone())
|
|
|
|
|