UNPKG

kapi-framework

Version:

A framework to shift the focus towards business logic.

12 lines (7 loc) 398 B
module.exports = (Config) => { const { Resources } = Config; return (ctx) => { // The master call, to where all the requests are routed. The requests doesn't hold any platform specific data, like HTTP headers to promote portability. Adapters had to written for the target platforms. const { User, resource, action, Data } = ctx; Resources[User.role][resource][action](Data, User); }; };