A simple mean stack framework
- Go to your project directory using your command line tool then install the following:
npm install
bower install
- Setup
.envfile using your command line tool.
cp .env.example .env
- Run the server, and you're good to go.
node server.js
GET Method
route.get('<uri>', '<controller>@<method>', [<middlewares>])POST Method
route.post('<uri>', '<controller>@<method>', [<middlewares>])UPDATE Method
route.update('<uri>', '<controller>@<method>', [<middlewares>])DELETE Method
route.delete('<uri>', '<controller>@<method>', [<middlewares>])RESOURCE Method
route.resource('<uri>', '<controller>@<method>', [<middlewares>], {only|except})In resource method, it provides get, post, update, and delete method. These are the following methods in controller that uses resource method:
indexfor GET Methodcreatefor GET Methodstorefor POST Methodshowfor GET Methodeditfor GET Methodupdatefor UPDATE Methoddestroyfor DELETE Method
You can also limit by using only or except. See example below:
Example #1
module.exports = function (app) {
route.setModule('User');
...
route.resource('/user', 'UserController', ['User::client'], {
only: ['index', 'show']
});
...
}Example #2
module.exports = function (app) {
route.setModule('Blog');
...
route.resource('/api/blog', 'UserController', ['Auth::isAdmin'], {
except: ['create', 'edit']
});
...
}route.group({ prefix: 'foo', middleware: ['Foo::bar', 'John::doe'] }, function () {
...
// Insert route methods here
...
});Note: Not yet implemented -- Nested Route Groups
This project is licensed under the MIT License - see the LICENSE file for details