1.0.8 ā€¢ Published 12 months ago

express-server-kit v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

boilerplate

express-server-kit

VERSION

LICENSE

AUTHOR

Express-Server Boilerplate

A boilerplate/starter project for quickly building RESTful APIs using Node.js, Express, and Mongoose.

By running a single command, you will get a production-ready Node.js app installed and fully configured on your machine.

Installation šŸ­

$ npm install -g express-server-kit

Quick Start šŸƒā€ā™‚ļø

The quickest way to get started with express is to utilize the executable express-server to generate an application as shown below:

Create (and start) the app in current folder:

$ express-server .
$ npm run dev

OR, create (and start) the app (in project_name folder):

$ express-server project_name
$ cd project_name
$ npm run dev

This will basically create this structure in your folder

.....................................
ā”œā”€ā”€ .env
ā”œā”€ā”€ .gitignore
ā”œā”€ā”€ app.js
ā”œā”€ā”€ node_modules
|    ā””ā”€ā”€ ....
ā”œā”€ā”€ package-lock.json
ā”œā”€ā”€ package.json
ā”œā”€ā”€ routes
|    ā””ā”€ā”€ indexRoute.js
|    ā””ā”€ā”€ userRoutes.js
ā”œā”€ā”€ controllers
|    ā””ā”€ā”€ indexControllers.js
|    ā””ā”€ā”€ userControllers.js.js
ā”œā”€ā”€ models
|    ā””ā”€ā”€ userModels.js
ā”œā”€ā”€ views
|    ā””ā”€ā”€ index.html
.....................................

Environment Variables

The environment variables can be found and modified in the .env file. They come with these default values:

#port
PORT=4000

#mongodb uri
URI=mongodb://127.0.0.1:27017

#mongodb database
DB=my_database

What dependencies it installs ?

  • express - express framework
  • mongoose - Mongoose(MongoDB object modeling tool)
  • dotenv - for env variables
  • cors - enable CORS
  • http-errors - to create http errors
  • morgan - to log http requests
  • nodemon (dev) - monitors changes in files

Author āœļø

Naqvi šŸ‡©šŸ‡Ŗ

Contribute šŸ¤

You can fork this repo and send me a PR.

1.0.8

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago