wolverinejs
v0.0.7
Published
simple node js framework
Downloads
24
Maintainers
Readme
WolverineJS
Simple MVC framework based on Node JS
installation
you can install with its generator.
npm install wolv -g
then , it will do the rest of the thing
wolv yourAppName
or
wolv
thts it . it will generate the primary boilerplate for you .
It uses ExpressJS and Nunjucks templating engine . This is the basic folder structure .
.
├── README.md
├── app
│ ├── controllers (folder)
│ │ ├── Auth
│ │ │ └── AuthController.js
│ │ ├── userController.js
│ ├── models (folder)
│ │ ├── article.js
│ │ ├── product
│ │ │ └── products.js
│ │ ├── book.js
│ │ └── user.js
│ └── views (folder)
│ ├── base.html
│ ├── home.html
├── app.js
├── config (folder)
| ├── routes.js
├── package.json
└── public (folder)
| ├── css
| ├── img
| └── js
into the app.js
file you need to include this , it will handle rest of the thing automatically .
var wolverine = require('wolverinejs');
It will boostrap your application and all models , controller , routes will be included .
check demo
folder , write node app.js
to run this form demo folder .
Routes
you can set your routes into app/config/routes.js
, the format will be like this
module.exports = function(router , controller){
// controller.great.index means , it will be into the app/controllers
// folder and the name of the controller is AuthController and
// index method will be executed
router.get('/', controller.AuthController.index );
router.get('/test',function(rep , res , next){
res.send('hello world');
});
return router;
}
Views
By default it uses Nunjucks
[ http://nunjucks.jlongster.com/ ] . Your view files will be loaded from app/views
folder . Its possible to extend template , it has many option , you can read form here http://mozilla.github.io/nunjucks/templating.html
Controllers
Controller will be into app/controllers
directory and it follows
exports.index = function(req , res){
// index.html is nunjucks templating file and it
// will be loaded from app/views/ folder
res.render('index.html',{title:'Please Sign up'});
}
Models
models will be into app/models
folder
Todo
- ORM support for major database engines .
- Configuration override
- App environment settings
- Error & Event Handling
- Passport
- SockJS
- Test
Note :
Its a very simple framework that follows MVC patterns , very light weighted , still in heavy development