This application is a small web the lets the user randomly draw two poker hands and rank them.
To start the application locally follow these steps;
From the root, install the required dependencies by executing the follow command in you terminal;
npm i
To run a local instance of the app you can either, run the development environment or build and the run a production ready version.
For running the development environment, with hot-reloads and so on;
npm run dev
For running the production ready version;
npm run build && npm run start
When either of the commands is executed, open http://localhost:3000 with your browser to go to the application.
There's also an API with two endpoints within the app itself.
Draw cards will return an array with two random generated poker hands. To access this endpoint go to http://localhost:3000/api/draw-hands.
Rank hands takes data for two different hands as query parameters. To access this endpoint go to http://localhost:3000/api/rank-hands. Here's an example request with hands defined; http://localhost:3000/api/rank-hands?handOne=3♥,7♥,3♣,J♥,3♠&handTwo=J♣,T♥,3♦,K♠,5♠.
There are some small tests in the project, that tests basic Poker logic. To run the tests execute the following command;
npm t