Closed olanod closed 3 years ago
Related to #8 and possibly #13, there should be an easy way to have some state that is shared across requests(e.g. a DB connection). One way is attaching data to context that is passed to requests, middlewares and possible plugin life-cycle hooks.
#[hook] async fn on_created(cx: &mut Context) {...} #[vlugin] async fn handler(req: Request, cx: &Context) -> Response {...}
Related to #8 and possibly #13, there should be an easy way to have some state that is shared across requests(e.g. a DB connection). One way is attaching data to context that is passed to requests, middlewares and possible plugin life-cycle hooks.