Project name: SurpriseMe
node version : v14.1.0
npm version : 6.14.5
In order to run my project, please clone the repo and then run the following commands:
npm install
node main.js
I configured the server on port 3000. Therefore, you should call my endpoint with a "http://localhost:3000" url prefix.
for example, "http://localhost:3000/api/surprise?name=Daniel&birth_year=2007".
I have written two test suites , Unit tests and E2E tests, if you would like to run them use the following command:
npm run test
I have added another surprise for you - useless facts. If this type was chosen, we should return a random useless fact.
This type will be chosen only if the user’s birth year is divided by 3 with no remainders.
Enjoy :)