Balou9 / bcg-coding-challenge

BCG Digital Ventures Backend Coding Challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ci

bcg-coding-challenge

I have build an API with a single endpoint that performs a checkout action. The single endpoint takes a list of watch ids and returns the total price. In terms of programming language & framework, i am working with node.js and serverless.

usage

setup

Work with two consoles.
Open the first console and type in the following:

git clone https://github.com/Balou9/bcg-coding-challenge.git  
cd bcg-coding-challenge/extermitators-api && npm i  

Open the second console from the same directory and type in the following:

serverless offline start --noPrependStageInUrl

send post request to localhost

Send the sample curl request from the first console

chmod +x ./sample.sh && ./sample.sh
// "{\"price\":650}"

test

The unit tests are defined in test.js and will be runned any time a push is made to the repo.

Run tests locally in api directory:

npm test

improvements // to do's

  • add cd to the pipeline
  • calcTotalPrice to async
  • add and test statusCode edge cases

About

BCG Digital Ventures Backend Coding Challenge


Languages

Language:JavaScript 87.3%Language:Shell 12.7%