express-routes-generator-cli

1.0.2 • Public • Published

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 !

Package Sidebar

Install

npm i express-routes-generator-cli

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

17.8 kB

Total Files

16

Last publish

Collaborators

  • orivoir21