项目作者: pcriv

项目描述 :
Mancala game implementation in Go as an API
高级语言: Go
项目地址: git://github.com/pcriv/mancala.git
创建时间: 2020-02-01T16:55:57Z
项目社区:https://github.com/pcriv/mancala

开源协议:MIT License

下载


Mancala

Mancala game implementation in Go as an API.

Usage

To run the server locally run the following command:

  1. make setup
  2. make rest-server

Once you have the server running.

You can access the API docs at localhost:1323/docs

To create a new game:

  1. curl -X POST localhost:1323/v1/games -H "Content-Type: application/json" --data '{"player1":"Rick","player2":"Morty"}'

To show the state of a game:

  1. curl localhost:1323/v1/games/:id

To perform the next play:

  1. curl -X POST localhost:1323/v1/games/:id/plays -H "Content-Type: application/json" --data '{"pit_index":0}'

Notes

Games expire after 2 hours.

License

Copyright 2023 Pablo Crivella.
Read LICENSE for details.