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