microscope-web
ES6, Express/Connect fully compatible, POO & Modular Web framework.
Requirements
- node
- npm
- gulp
Node.js installation
Install on OSX
Using homebrew:
brew install node
Install on Linux (Ubuntu/Mint)
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
Install on Windows
Installation
install gulp (sudo on linux/OSX) :
npm install gulp -g
install dependencies (sudo on linux/OSX) :
npm install
Development commands
test (run gulp test):
npm test
test:
gulp test
- validate source code (jsHint).
docs:
gulp docs
- generate annoted code documentation (docco).
- generate annoted code samples documentation (docco).
How to use ?
Check out project samples !!!
Application class
With ES5
var HttpApplication = HttpApplication;var HomeController = ;var AuthApplication = ;var logger = ; var Application = HttpApplication; moduleexports = Application;
With ES6
;;;; // register application controllers in array { return HomeController; } // register application middlewares in array // templateEngine, logging, authentication, ... // call middleware with express instance in parameter. // configure using app.use([middleware]); { return logger; } // use AuthApplication class as sub application // map to /auth/{controller}/{action} { return '/auth': AuthApplication } var a = ;a;
With experimental ES7
;;;; var controllers middlewares areas = decorators; @@@ var a = ;a;
Controller class
With ES5:
var Controller = Controller;var filters = ; var HomeController = Controller; moduleexports = HomeController;
With ES6:
;; // add some controllers filter { return controllerFilter; } // configure controller routing with callback array { return 'get /': actionFilter 'index' 'get /home/about': 'about' } // index action // GET / { response; } // about action // GET /home/about { response; } ;
With experimental ES7
;;var filters routes = decorators; @@ // index action // GET / { response; } // about action // GET /home/about { response; } ;
Roadmap
- TypeScript definition support