auric-runtime 0.1.6

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

#[derive(Default)]
pub struct DefaultRoute {}

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

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