A MongoDB + NodeJS + Typescript APi with a single endpoint.
-
Clone the project
git clone https://github.com/bruno-queiroz/plinko-challenge.git
-
Install dependencies
npm install
-
Create a .env file on the root of the project
-
Copy the environment variable from the .env.example file to the .env file
-
Make sure to have MongoDB running locally
sudo systemctl start mongod
-
Run the app
npm run dev
GET /bet?bet=3&rows=8&risk=low
curl -i -H 'Accept: application/json' http://localhost:3000/bet?bet=3&rows=8&risk=low
Params | Constraints |
---|---|
bet | A number value that should be greater than 1 |
rows | A number value that should be greater than 8 and less than 16 |
risk | 3 possible options: "low" | "medium" | "high" |
Run tests
npm run test