#:black_joker: Deck of Cards :black_joker: A simple web app that allows users to draw from, shuffle, and reset a deck of playing cards. The app is live here.
##Description
When the server starts, the standard 52 playing cards are added to the deck. Users can then draw cards from the deck until it is empty. Once the deck is empty, users may reset the deck to start over.
The deck is not shuffled by default, but users may shuffle it at any time. Users can also check how many cards are left in the deck. Although the deck contains the regular 52 cards, users may also add additional cards.
POST /card
: Adds a card to the deckcurl -i -X POST -d '{ "suit": "S", "rank": "A" }' http://localhost:5000/card
-->HTTP/1.0 201 CREATED
PUT /card
: Draws a card from the deck. If the deck is empty then returns an errorcurl -X PUT localhost:5000/card
-->{"rank": "A", "suit": "S"}
curl -X PUT localhost:5000/card
-->{"errorMessage": "No cards to draw. Please reset the deck or add cards."}
PUT /shuffle
: Shuffles the cards in the deckPUT /reset
: Puts all the drawn cards back in the deckGET /numCardsLeft
: Gets the number of cards left in the deckcurl -X GET https://deck-of-cards.herokuapp.com/numCardsLeft
-->{"numCardsLeft": 50}
- Download and install Python 3.5
- Clone this repository to your machine
- Open a terminal and change into the root of the repository
- Install virtualenv
$ pip install virtualenv
- Create a virtual environment
$ virtualenv venv
- Activate the virtual environment
$ source venv/bin/activate
- Install dependencies
$ pip install -r requirements.txt
$ python start_server.py
$ pytest tests