Skip to content

fmiskovic/toggl-card-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project toggl-card-game

This is a coding challenge project given by Toggl.com hiring team.

NOTE:

The data is stored in memory and not persisted into a DB or FS.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

  1. First clone the repository to your local machine.
  2. Execute the following command to run api server locally:
make run

Testing

test create new default deck endpoint

curl -X POST http://localhost:8080/api/deck

test create new full shuffled deck endpoint

curl -X POST -G 'http://localhost:8080/api/deck' -d 'shuffle=true'

test create new deck with custom cards endpoint

curl -X POST -G 'http://localhost:8080/api/deck' -d 'cards=2C,3D,10H,KC'

test open existing deck endpoint (replace <deck_id> with actual deck id)

curl -X GET http://localhost:8080/api/deck/<deck_id>

test draw card from deck endpoint (replace <deck_id> with actual deck id and count number)

curl -X PUT http://localhost:8080/api/deck -d '{"deck_id": "<deck_id>", "count": 2}'

Makefile Commands Description

build the application

make build

run the application

make run

run the test suite

make test

run test coverage

make test-cover

clean up binary from the last build

make clean

About

Toggl.com card game project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published