Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.
/ NodeApi Public archive

⏳ a Node API with es6 syntax and promises

Notifications You must be signed in to change notification settings

zelazna/NodeApi

Repository files navigation

Node API & Customers List

Build Status Code Climate Test Coverage js-standard-style

Intro

WIP

1. Dependencies et Requirements

  • Sequelize with postgresql
  • Redis
  • Node with Express
  • Mocha & Chai
  • ESLint Standard

Installation

npm install

Copy the .sample.env into .env and fill it with your databases Urls and API keys
for run tests create a .test.env

2. Endpoints

Authentification

METHOD URL ACTION
GET /login get a token for perform requests on /customers

CRUD Operation

Manage a customers list , the endpoints follow the REST API principles :

METHOD URL ACTION
GET /customers get all customers
GET /customers/1 get the customer with id 1
POST /customers create a customer
PUT /customers/1 update the customer with id 1
DELETE /customers/1 delete the customer with id 1

3. Commands

run the API ( rely on nodemon for now) :

npm start

launch tests (generate code coverage with istanbul as well) :

npm test

debug the application ( with a debugger statement):

npm run debug

generate credentials:

./cli.js username password --save