#![feature(decl_macro)]
#[macro_use] extern crate rocket;
use std::env;
use rocket_dyn_templates::Template;

mod page;
mod category;
mod video;
mod thumbnail;
mod common;

#[tokio::main]
async fn main() {
    // emoji's crash my terminal
    env::set_var("ROCKET_CLI_COLORS", "false");
    /*
     * Some of the target vars that we look for
     * CLIP_DIR
     */
    let _ = rocket::build()
        .mount("/", routes![page::home, page::category, page::video])
        .mount("/static", routes![page::files])
        .mount("/api", routes![category::list, video::list])
        .mount("/thumbnail", routes![thumbnail::get])
        .attach(Template::fairing())
        .launch().await;
}
