1.0.2 • Published 5 years ago

express-routes-generator-cli v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

express-routes-generator-cli

command line interface of express-routes-generator

installation

  • npm i express-routes-generator-cli --save
  • yarn add express-routes-generator-cli

usage:

from console: .\node_modules.bin\express-routes-generator-cli build product

script define

{
    "scripts": {
        "crud": "express-routes-generator-cli"
    }
}

usage:

from console: npm run crud build product

generate files crud routes and build structure directories , build too an file all-routes.js with e.g:

const Product = require('./product');
const Article = require('./Article');

module.exports =
/**
 * @class Routes
 * @classdesc implement all routes
 */
class {

    constructor( app ) {

        new Product( app ) ;
        new Article( app ) ;

    }

} ;

for implements all routes with one call

server.js

const
    express = require('express')
    ,app = express()
    ,Routes = require('./routes/all-routes')
;

new Routes( app ) ; // implements route

for reset data build all-routes.js use:

npm run crud reset

develop by Samuel Gaborieau with <3 and Nodejs for OpenSource , enjoy !