server

command module
v0.0.0-...-8a0841e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2019 License: MIT Imports: 14 Imported by: 0

README

Golang Server

Grab set1-en_us.json

If you're on Linux, run the script provided at server/pull-data.sh.

Environment Variables

PORT: the port the web server listens to, defaults to 8080

Routes

After the very first game:

Request:

POST /cards
[
	"01IO026",
	"01DE020"
]

Response:

{
  "id":"1197794836317474816",
  "href":"",
  "win":true,
  "result":{
    "Regions":["Ionia","Demacia"],
    "Set":{"Demacia":600,"Ionia":600}}
  }

Updating Points after other games:

Request:

PUT /cards/1197794836317474816
[
	"01IO026",
	"01DE020"
]

Response:

{
  "id":"1197794836317474816",
  "href":"",
  "win":true,
  "result":{
    "Regions":["Ionia","Demacia"],
    "Set":{"Demacia":1100,"Ionia":1100}}
  }

Viewing Results

Request:

GET /view/1197794836317474816

Response: a web page

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL