A project component to the Intro to PHP shortcourse at The Open Window.
An API + UI to shuffle a deck of cards.
All responses will be JSON in the form of:
{
"code": "2xx/4xx/5xx",
"status": "success/error",
"body": Endpoint Response (see below)
}
Shuffle and save new deck.
Returns:
{
"id": "{new-guid}",
"deck": [
{
"card": "ace",
"suit": "spades",
"number": 13,
"colour": "black"
},
// etc
]
}
Shuffle and update an existing deck.
If no such
{id}
exists, an error will be thrown.
Returns:
{
"id": "{id}",
"deck": [
{
"card": "three",
"suit": "hearts",
"number": 3,
"colour": "red"
},
// etc
]
}
Get the cards of a shuffled deck.
If no such
{id}
exists, an error will be thrown.
Returns:
{
"id": "{id}",
"deck": [
{
"card": "king",
"suit": "clubs",
"number": 12,
"colour": "black"
},
// etc
]
}
Delete an existing deck of cards.
If no such
{id}
exists, an error will be thrown.