This api is built to support our mobile and web applications. It is developed by the following swagger specification: Documentation
Clone the repo:
git clone https://github.com/BarFlow/api.git
cd api
Install dependencies:
npm install
Start server:
# set DEBUG env variable to get debug logs
DEBUG=barflow-api:* npm start
# OR
# requires gulp to be installed globally
npm i -g gulp
gulp serve
Execute tests:
# compile with babel and run tests
npm test (or gulp mocha)
# use --code-coverage-reporter text to get code coverage for each file
gulp mocha --code-coverage-reporter text
Other gulp tasks:
# Wipe out dist and coverage directory
gulp clean
# Lint code with ESLint
gulp lint
# Default task: Wipes out dist and coverage directory. Compiles using babel.
gulp
Logs detailed info about each api request to console during development.
Logs stacktrace of error to console along with other details.
Get code coverage summary on executing npm test
npm test
also generates HTML code coverage report in coverage/
directory. Open lcov-report/index.html
to view it.
Project is based on Kunal Kapadia's @kunalkapadia12 express-mongoose-es6-rest-api