#[macro_use]
extern crate lazy_static;

use actix_web::{ web, App, HttpServer };
use actix_files as fs;

mod build_actix;

use crate::build_actix::route;


#[actix_web::main]
// return Result or io::Error
async fn main() -> std::io::Result<()> {

    HttpServer::new( 
        || {
            App::new()
            .service( fs::Files::new("/assets", "./templates/assets/").index_file("index.html"))
            .route("/", web::get().to(route::index))
            .route("/hemp", web::get().to(route::hemp))
            .route("/spider", web::get().to(route::spider))
            .route("/kaoscube", web::get().to(route::cube))
            .route("/cyberpreneur", web::get().to(route::cyber))
            .route("/offgrid", web::get().to(route::off))
        })
        .bind("0.0.0.0:5000")?
        .run()
        .await
}
