express-dispatcher
Dispatcher for expressjs : Under development !
Installation
$ npm install -g express-dispatcher
Usage exemple
// controllers/routes.jsexportsroutes = app: 'index' : path: '/' controller: 'index' action: 'index' view: 'index' method: 'GET' isSecure: false 'about' : path: '/about' controller: 'about' action: 'index' method: 'POST' isSecure: false routes: 'blog' : 'blog/routes' 'user' : 'user/routes' ; // for "/" VERB, load "controller/index" from "./controllers/main/index"// and execute "index" action // code of "controllers/index.js"var main = exports_controller = { console; res; } //...;
Let's starting with a simple configuration of nodejs
var express = http = path = dispatcher = dispatcher; var app = ; app; app; // This dispatcherdispatcher; var server = http; server;
Our MVC architecture
app.jscontrollerscontrollers/routes.jscontrollers/main/index.jsmodelsviewsviews/index.jspublic