Rapid NodeJS REST API Server generator with generator-restgoose and yo

Home  >>  Web Application Development  >>  Rapid NodeJS REST API Server generator with generator-restgoose and yo

Rapid NodeJS REST API Server generator with generator-restgoose and yo



Rapid NodeJS REST Server generator

So I just finished writing and testing the all new generator-restgoose, inspired (forked) from Antonio. I basically changed the core pattern of how MVC code is generated and segregated them, optimized and upgraded many deprecated code, and updated the mocha test. Here is the Rapid NodeJS REST Server generator I have been talking about.

generator-restgoose on GiitHub

generator-restgoose on Travis CI


Travis also gave generator-restgoose green signal and its now ready out-of-the-box for your rapid NodeJS REST server development.


Quick Guide:

Not every new computer comes with a Yeoman pre-installed. He lives in the npm package repository. You only have to ask for him once, then he packs up and moves into your hard drive. Make sure you clean up, he likes new and shiny things.

Generator Restgoose

While running through a leafy mongodb field he picked up restgoose.

To install generator-restgoose from npm, run:

Finally, initiate the generator:

It should output a file structure similiar to:

Don’t forget to checkout the config/lib.js file which contains many useful stuff (Json Validator, image to Base64 Converter, etc). Use the Library as var l = require('../config/lib.js); ( which generates with every sub schema).

Try to use l.p('Print something'); to log something. This will log to debug.log file.

Logging Two log files are served : debug.log and access.log.


Run the app

Development mode


Production mode

Sub Generator Schema

Run the sub generator for schemas:

Yet why another generator?

Rapid NodeJS REST Server generator comes with out-of-box JWT User Security Implementation. The Rest Server stands on NodeJS + Experess JS + Mongoose + Grunt and many more industry standard modules to give you the fun to actually develop the business and worry less about setting up the environment.





Leave a Reply