diff --git a/README.md b/README.md index f14ae48..0d8ec80 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Perfectionist generator that scaffolds out different types of Frontend applicati - **Simple Web App** — Sometimes you just need a gulp server(localhost), scss compiler & browser-sync(live reload). Well that's exactly what this app is for. - **Full Pack Web App** - Thinking of creating a solid frontend base with proper structure, well optimization; choose this applicaton type which comes with power features. - **Angular App** - Angular app with basic configurations and quick commands for creating controllers, directives, services and filters. More to come! +- **Restify App** - API developer? Want to create REST API services with mongodb, This app type got your back which scaffolds basic files like models, controller, routes, db & config. # Getting Started @@ -167,6 +168,24 @@ Your directory structure will look like this └── .gitignore ```````` +**Restify App** + +```````` +├── controllers +│ └── userController.js +├── models +│ └── userSchema.js +├── route.js +├── app.js +├── config.json +├── db.js +├── node_modules +├── package.json +├── gulpfile.js +├── .gitattributes +└── .gitignore +```````` + # Quick commands Terminal commands to speed up repetitive tasks you do in projects. Simple app idea is to maintain as minimal as possible; so quick commands won't work. @@ -257,5 +276,5 @@ Contribution would be of great help to create a solid generator for frontend pro **Active Contributers** -[![Logesh Paul](https://avatars3.githubusercontent.com/u/41541?v=3&s=72)](http:/www.github.com/logeshpaul) [![Gokulakrishnan](https://avatars0.githubusercontent.com/u/2944237?v=3&s=72)](https://github.com/gokulkrishh) [![Ritesh Babu](https://avatars3.githubusercontent.com/u/736660?v=3&s=72)](https://github.com/riteshbabu) [![Sugan Krishnan](https://avatars1.githubusercontent.com/u/680120?v=3&s=72)](https://github.com/rgksugan) +[![Logesh Paul](https://avatars3.githubusercontent.com/u/41541?v=3&s=72)](http:/www.github.com/logeshpaul) [![Gokulakrishnan](https://avatars0.githubusercontent.com/u/2944237?v=3&s=72)](https://github.com/gokulkrishh) [![Thiyagarajan](https://avatars2.githubusercontent.com/u/9147343?v=3&s=72)](https://github.com/ThiyagarajanJ) [![Ritesh Babu](https://avatars3.githubusercontent.com/u/736660?v=3&s=72)](https://github.com/riteshbabu) [![Sugan Krishnan](https://avatars1.githubusercontent.com/u/680120?v=3&s=72)](https://github.com/rgksugan) diff --git a/app/templates/_typeRestifyApp/_app.js b/app/templates/_typeRestifyApp/_app.js index 840a251..1ccfde5 100644 --- a/app/templates/_typeRestifyApp/_app.js +++ b/app/templates/_typeRestifyApp/_app.js @@ -8,6 +8,5 @@ app.use(restify.queryParser()); app.listen(config.port, function() { console.log('server listening on port number', config.port); - }); var routes = require('./routes')(app); \ No newline at end of file diff --git a/app/templates/_typeRestifyApp/_routes.js b/app/templates/_typeRestifyApp/_routes.js index f0f5136..df254d5 100644 --- a/app/templates/_typeRestifyApp/_routes.js +++ b/app/templates/_typeRestifyApp/_routes.js @@ -1,9 +1,9 @@ module.exports = function(app) { - var user = require('./controllers/userController'); - + var user = require('./controllers/userController'); + app.get('/', function(req, res, next) { return res.send("WELCOME TO REST API"); }); - app.post('/createUser', user.createUser); + app.post('/createUser', user.createUser); }; \ No newline at end of file diff --git a/app/templates/_typeRestifyApp/_userController.js b/app/templates/_typeRestifyApp/_userController.js index 213a34e..ecc2ca5 100644 --- a/app/templates/_typeRestifyApp/_userController.js +++ b/app/templates/_typeRestifyApp/_userController.js @@ -2,18 +2,18 @@ function userController () { var User = require('../models/userSchema'); - + // Creating New User this.createUser = function (req, res, next) { var name = req.params.name; var email = req.params.email; var age = req.params.age; var city = req.params.city; - + User.create({name:name,email:email,age:age,city:city}, function(err, result) { if (err) { console.log(err); - return res.send({'error':err}); + return res.send({'error':err}); } else { return res.send({'result':result,'status':'successfully saved'}); diff --git a/app/templates/_typeRestifyApp/_userSchema.js b/app/templates/_typeRestifyApp/_userSchema.js index a1019ea..a4cf030 100644 --- a/app/templates/_typeRestifyApp/_userSchema.js +++ b/app/templates/_typeRestifyApp/_userSchema.js @@ -1,4 +1,4 @@ -// Model for the Student +// Model for the Student module.exports = (function userSchema () { var mongoose = require('../db').mongoose; @@ -12,6 +12,6 @@ module.exports = (function userSchema () { var collectionName = 'user'; var userSchema = mongoose.Schema(schema); var User = mongoose.model(collectionName, userSchema); - + return User; })(); \ No newline at end of file diff --git a/package.json b/package.json index 7877fcc..28d893f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "generator-smacss", - "version": "0.2.2", + "version": "0.2.3", "description": "Perfectionist Frontend Generator", "author": { "name": "Logesh Paul", diff --git a/release.md b/release.md index 17e944c..e446771 100644 --- a/release.md +++ b/release.md @@ -1,5 +1,9 @@ # Release History +**v0.2.3** +- New App Type - Restify! With generator-smacss you can create restify apps. +- Code cleanup and improvements. + **v0.2.2** - Bower Components - Auto check dependencies and concat in right order