A simple web framework for Node.JS
This is a simple web framework based on Express and inspired from Sails.js. Under GPL v2 licence.
It uses Sequelize as ORM and Schema Inspector for data validation/sanitition. As it is based on ExpressJS, controllers are compatible with Connect middleware system, so migration from an ExpressJS project to Light API is quite simple.
- Create a Node application following this structure:
main_folder├─┬ api│ ├─ controllers│ └─ views└── config
- In the
controllersfolder, create a
IndexController.jsnode module. It will exports a object associating an action name to a function like this :
moduleexports =resrender"index.ejs" name: reqparamsname
- In the
viewsfolder, create a
index.ejstemplate, and type something like :
Hello <%= name %> !
- Finally, in the
configfolder, add a
router.jsnode module, which will define the routing of your application. The system is pretty much like Sails.js router (see http://sailsjs.org/#!documentation/routes), without resourseful routing.
moduleexports ="/:name": "IndexController:index"
app.jsnode module in the main folder and simply add that following line :
Launch the app :
node appand go to http://localhost:1337/World and magic will happend !
Documentation will be completed later, the roadmap a little bit before. For some examples of app build using Light API, see this repo, and have a look at the differents branches.