lest 0.2.1

A modular approach to a web server. Based on actix-web.
Documentation
use std::collections::HashMap;

use serde::{Serialize, Deserialize};

#[derive(Serialize, Deserialize, Debug)]
pub struct AppRootSchema {
    pub method: String,
    pub path: String,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct FragmentRouteSchema {
    pub method: String,
    pub guard: String,
    pub path: String,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct FragmentSchema {
    pub root: AppRootSchema,
    pub routes: Vec<FragmentRouteSchema>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ServedSchema {
    pub root: String,
    pub file_path: String,
    pub index_html: bool,
    pub excludes: Vec<String>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct RewriteSchema {
    pub from: String,
    pub to: String,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct AppSchema {
    pub root: AppRootSchema,
    pub fragments: HashMap<String, FragmentSchema>,
    #[serde(rename = "static")]
    pub static_dirs: HashMap<String, ServedSchema>,
    pub rewrites: Vec<RewriteSchema>,
    pub templates: HashMap<String, String>,
}