Create a simple API to support a chessboard
see requirements.txt for more detail
reference: http://en.wikipedia.org/wiki/Algebraic_chess_notation
Install NodeJS - refer http://nodejs.org/
npm install express
Testing Framework
npm install expresso
Development
$ nodejs d.js app.js
This will autostart express each time a file is changed
clears any existing game and resets the board pieces
method: delete (may just use get for simplicity of browser access)
url: /reset
success: 200
note: Board will be created automatically if any of the bellow methods are called
returns - entire board with pieces locations
method: get
url: /
success: 200 json formatted { a1: "WR", b2: "WN", ... g8: "BN", h8: "BR" }
Returns a single cell on the chess board
method: get
url: /show/:loc
:loc is based on chessboard notation
valid value options are [a..h][1..8]
valid: 200
{ a1: "" }, if no piece on square
or
{ a1: "WR" }
invalid: 400
Move a piece from one position to another
method: put (may just use get for simplicity of browser access)
url: /move/:from/:to
valid value options for :from & :to are [a..h][1..8]
valid: 200
{ removed: "WK" } or piece value or empty string
invalid: 400