The currency exchange service is a microservice designed to convert currency values for the Bee Travels travel application using an external API.
We recommended using Node Version Manager (NVM) to run various versions of Node. if you don't have it already installed check it out Installing NVM here
Or just use Node v10.16.3 ( Which is what we used to test this service )
node -v
v10.16.3
npm -v
6.9.0
git clone https://github.com/bee-travels/bee-travels-node
cd src/currencyexchange
npm install
#if developing, install dev Dependacies
npm install --save-dev
#build
npm run build
#run unittests
npm run test
#run the environment in development mode
npm run dev
#additional development commands
echo "run linter"
npm run lint
echo "run code formatter"
npm run format
#run production
npm run start
Then simply navigate to http://localhost:9201 and test out this microservice API endpoints using the Swagger test harness page.
git clone https://github.com/bee-travels/bee-travels-node
cd src/currencyexchange
docker build -t beetravels-node-currencyexchange .
docker run -it beetravels-node-currencyexchange
Then simply navigate to http://localhost:9201 and test out this microservice API endpoints using the Swagger test harness page.
Bee Travels currently supports deploying to the Cloud using the following configurations:
- Helm
- K8s
- Knative
For instructions on how to deploy the currency exchange service to the Cloud, check out the config repo for the Bee Travels project.
read more about Jest - a delightful JavaScript Testing Framework here
moved tests out of test folder to be adjacent to files been tested - motivations:
- scale - each file should have a corresponding test file with pattern
test
orspec
https://kentcdodds.com/blog/colocation
uses npm lib csvtojson
very nice as cuts down lines code drastically.
mostly using async / await over explicit
promises. async/await uses promises under the covers, also reduces lines of code drastically.
The Cost of Logging - Pino vs Winston benchmarks by Matteo Collina