1.2.2 • Published 5 years ago

@fridsn/create-express-api v1.2.2

Weekly downloads
28
License
MIT
Repository
github
Last release
5 years ago

create-express-api

Installation

This is a Node.js module available through the npm registry. This Module will scaffold a basic REST API (Node-Express-Mongoose) for you.

Installation is done using the npm install command:

$ npm i @fridsn/create-express-api -g

Usage

$ create-express-api new-project
$ cd new-project
$ npm start

Structure

new-project
├── package.json
└── src
    ├── App.js
    ├── models
    │   └── User.js
    ├── modules
    │   └── users.module.js
    ├── routes
    │   └── users.router.js
    ├── server.js
    └── tools
        └── mongoose.js
$ cd new-project && npm start

ENV

You can add variables to the Environment variables to get access to your DB or just to save other stuff.

I used .dotenv for development. Just add a .env file in your root project folder and store your variables in there.

API_PORT=$PORT
API_NAME=$API_NAME
MONGO_HOST=$MONGO_HOST
MONGO_PORT=$MONGO_PORT
MONGO_DB=$MONGO_DB
MONGO_USER=$MONGO_USER
MONGO_PASS=$MONGO_PASS
1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago