auric 0.1.2

CLI for the Ember-inspired Auric SPA framework
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use auric_runtime::routing::{Path, Route, RouteDef};
use auric_runtime::{AuricRoute, Context};
use auric_runtime::{async_trait::async_trait, bson};

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

#[async_trait]
impl Route for {{structName}} {
    async fn model(&self, _ctx: &impl Context, _params: &Path<RouteDef>) -> anyhow::Result<bson::Document> {
        Ok(bson::doc! {})
    }

    fn name(&self) -> &'static str {
        "{{name}}"
    }
}