Starter code for node/express based API
The Node Boilerplate exposes a well documented JSON:API Spec Compliant REST API that can be used by external services to access & manipulate the data.
API Documentation:
- A postman collection of the API requests is available at https://www.getpostman.com/collections/c0bf860e4d4442dcb504
Please get familiar with the components of the project in order to be able to use this boilerplate.
to install node boilerplate on your local system follow these steps -
clone this repo: use git clone https://github.com/tech-lcx/nodeBoilerPlate.git
change directory: cd nodeBoilerPlate
install npm modules: npm install
- use command
npm startto start the api - using API testing tools like postman hit the endpoint
localhost:3000/ - Route for updating user is authenticated. The
jwttoken obtained after login needs to sent in the authorisation header.
<dependency-info (if any)>
Add unit tests for a new features/functionality and put it in test/ folder.
Test are written using Mocha and Chai.
use the command npm test to run test cases. (Please make sure all test cases pass before pushing your code)
All the errors handling inside a middleware should be performed by setting the status code and the msgToCLient property of the error object and passing it to the next middleware.
Node Boilerplate uses winston for error and warning logs.
We have the following branches :
- development All development goes in this branch, please make sure that all the unit test pass locally before pushing your code to this branch.
- master This contains shipped code. After significant features/bug-fixes are accumulated on development, we make a version update, and make a release.
Commits
- Write clear meaningful git commit messages (Do read http://chris.beams.io/posts/git-commit/)