questionAPI/SETUP.md at develop · CodeRoyale/questionAPI

Prerequisites

Before starting to test this API locally you need to assure you have the following prerequisites:

Installation and usage

  1. Clone the repo and install all the required packages:
 git clone https://github.com/CodeRoyale/codeRoyale-Question-api
 cd codeRoyale-Question-api
 npm install

  1. Run development server command npm run dev

  2. Test by sending requests at localhost:3000

Testing

  1. To run all the tests with mocha:

Development

Before starting to make changes

  1. Create a new branch
git checkout -b branch_name

  1. Make your relevant changes

  2. Make appropriate changes in test if have changed the API or created new API

  3. Make sure to document the changes in code by commenting it. Make relevant changes in swagger documentation if required.

  4. To run all the tests with mocha before commiting it:

Before Commiting / Pushing to repo

  • Format all files supported by Prettier in the current directory and its subdirectories
  • Check that all files match prettier code style
  • Run eslint to check whether all files follow the lint rules
  • Run eslint to handle the simple fixes automatically