Base creation page

This commit is contained in:
Jai A
2020-06-22 21:04:17 -07:00
parent 1f4985c7dd
commit 23503dc439
10 changed files with 123 additions and 22 deletions

View File

@@ -12,6 +12,7 @@ use actix_web::{web, App, HttpServer};
use handlebars::*;
use actix_web::middleware::Logger;
use env_logger::Env;
use std::env;
mod database;
mod helpers;
@@ -20,12 +21,12 @@ mod routes;
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
env_logger::from_env(Env::default().default_filter_or("info")).init();
dotenv::dotenv().ok();
//Handlebars
let mut handlebars = Handlebars::new();
handlebars.register_helper("contains", Box::new(helpers::ContainsHelper));
handlebars.register_helper("format", Box::new(helpers::HumanFormatHelper));
helpers::register_helpers(&mut handlebars);
handlebars
.register_templates_directory(".hbs", "./templates")
.unwrap();
@@ -36,6 +37,7 @@ async fn main() -> std::io::Result<()> {
routes::index_mods(client).await.unwrap();
info!("Starting Actix HTTP server!");
//Init App
HttpServer::new(move || {
App::new()