borgert-inc / express-api-startkit

API Startkit for node - express 4 + mongodb + eslint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Express API StartKit

Express API StartKit


Codacy Badge


Nodemon

npm install -g nodemon

Install packages

npm install

Copy .ENV

cp .env-example .env

Configure .env

MONGO_DB=mongodb://localhost:27017/mongo_db

Development (With nodemon watch .js)

npm run dev

http://localhost:3000

Eslint

npm run eslint

Slack

Insomnia

Use Insomnia to test the API endpoints, use the insomnia.json file that already has all the necessary endpoints. Download Insomnia.

Node Best Practices

https://github.com/goldbergyoni/nodebestpractices

Routes

Module Action Method Endpoint
Register Create POST http://localhost:3000/register
Login Login POST http://localhost:3000/auth/login
Logout Logout POST http://localhost:3000/auth/logout
Users All GET http://localhost:3000/users
Users Create POST http://localhost:3000/users
Users Update PUT http://localhost:3000/users/:id
Users Show GET http://localhost:3000/users/:id
Users Delete DELETE http://localhost:3000/users/:id

Packages

Package Description
bcryptjs Encrypt password
debug For Debug
dotenv-extended To work files .env
eslint Code standard
express Framework express
consign For load modules
http-errors Controllers http errors
method-override Overrise methods in express
moment To work with dates
mongoose ODM for database MongoDB
mongoose-paginate-v2 Paginate for mongoose
mongoose-validator Validator inputs for mongoose
winston Logs generator

About

API Startkit for node - express 4 + mongodb + eslint


Languages

Language:JavaScript 100.0%