npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

build-express-api

1.0.4 • Public • Published

Build Express Api

A Command line interface for instantly building an express rest api.
Create controllers, models and add routes in matter of seconds.

npm version

This CLI only supports Node 6 and over.

Installation

Install it globally:

$ npm install -g build-express-api

Getting Started

Initializing the application structure

$ mkdir my-app
cd my-app
$ build-express-api init

Directory structure

my-app
├── package.json
├── rest
    └── controllers
    └── models
    └── server.js

Install all the needed dependencies:

$ npm install

Note: when running all of the further commands, please stay in the my-app directory

Creating a new controller

$ build-express-api create-controller

The CLI will now take you through series of questions, the example of building a new controller would be:

? Controller name: authentication
? Controller type:
> Plain (Sample controller with 4 routes)
$   Custom routes

You can choose the plain controller or custom routes controller from the menu.
Plain controller just creates a controller with built in routes in rest/controllers/controllerName.js as shown in the picture below:

install

npm i build-express-api

Downloadsweekly downloads

58

version

1.0.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability