auric 0.1.6

CLI for the Ember-inspired Auric SPA framework
use anyhow::Result;
use auric_runtime::{AuricRoute, Context};
use auric_runtime::async_trait::async_trait;
use auric_runtime::routing::{Route, RouteModel};
use serde_json::{Value, json};

#[derive(AuricRoute, Default)]
#[route("{{path}}")]
pub struct {{structName}} {}

#[async_trait]
impl Route for {{structName}} {
    fn init(&mut self, _context: &dyn Context) -> Result<()> {
        Ok(())
    }

    async fn model(&self, _params: &[Value]) -> Result<RouteModel> {
        Ok(RouteModel::Json(json!({})))
    }
}

#[cfg(test)]
mod tests {
    use super::{{structName}};

    #[test]
    fn can_construct() {
        let _ = {{structName}}::default();
    }
}