We need an api to use for modules.
I think it should work like this:
Jakhu looks at a list of modules and requires each entry file for each module package.json)
INIT function is called on each module, using the params (app, jakhu, done). app is the express app object with some functions removed, jakhu is the jakhu api with tools for notifications, db, adding middleware, adding routes and pages and done(err, {function: function}) is a function to tell jakhu of errors and supply the RUN function.
INIT function returns done to run on jakhu to add routes .etc
done returns a err or function return value
RUN function (and other functions such as module.hello()) in done is executed
Module is running (i.e. watching for requests or using loaded express middleware)
When adding express middleware, the object in done includes an express function ({express: expressfunction}).
We need an api to use for modules. I think it should work like this:
package.json
)(app, jakhu, done)
.app
is the express app object with some functions removed,jakhu
is the jakhu api with tools for notifications, db, adding middleware, adding routes and pages anddone(err, {function: function})
is a function to tell jakhu of errors and supply the RUN function.done
to run on jakhu to add routes .etcdone
returns a err or function return valuemodule.hello()
) indone
is executedWhen adding express middleware, the object in
done
includes an express function ({express: expressfunction}).