Table of Contents
An API to create a deck of cards, open a deck of cards, draw one or multiple cards.
Before this project can be run locally you will need to install Go
To utilize the project, the following needs to be done:
- Clone this repository
- Install the dependencies, using the following command:
go mod tidy
- To run the project locally, use the following command:
go run main.go
- To create a deck of cards, use Postman to make a GET request to the following URL:
http://localhost:3000/api/create
- To open a deck of cards, use Postman to make a GET request to the following URL:
http://localhost:3000/api/open/{deck_id}
- To draw a card or multiple cards, use Postman to make a GET request to the following URL:
http://localhost:3000/api/draw/{deck_id}?count={any number}
Tests can be run using the following command:
go test ./...