Kirk
v0.1.0
Published
A framework for Express-based apps
Downloads
2
Readme
APPLICATION DIRECTORY STRUCTURE
lib/ /modules / init.js router.js /controllers Controller.js ...
/db
<db name>Db.js
...
/models
<model name>Model.js
...
To create a new module, simply create the lib/modules/// folder with the necessary files.
CONTROLLERS The Controller.js should export an instance of Controller as in the following example:
// lib/modules/core/user/userController.js
var userController = new Controller();
userController.printHello = funciton(){ console.log('hello'); }
module.exports = userController;
Controllers are accessible application-wide via . . As an example, to call the printHello function of the previous example: core.user.printHello(). The Controller class exposes the following utility methods:
- getDb(module) : gets the db script for
The Controller class extends the EventEmitter class by default.