Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.4 KB

README.md

File metadata and controls

39 lines (25 loc) · 1.4 KB

Node.js Chess Server

A Node.js app built using Express 4.

Running Locally

Make sure you have Node.js and the Heroku Toolbelt installed.

$ git clone [email protected]:heroku/node-js-getting-started.git # or clone your own fork
$ cd node-js-getting-started
$ npm install
$ npm start

Your app should now be running on localhost:5000.

Deploying to Heroku

$ heroku create
$ git push heroku master
$ heroku open

Documentation

This is a Node.js server that can provide hints for a player during a chess game. Sending a GET request to this server with the current configuration of a chess board and the color whose turn it is will cause the server to respond with a good move for that color.

Formatting the request Assuming that this server is running on a url titled <url>, one can obtain a hint with a request in a format similar to the following:

<url>/get-move?board=RNBQKBNR|PPPPPPPP|--------|--------|--------|--------|pppppppp|rnbqkbnr&color=white

The response from the server will look like this:

H1H2

Currently, this app is running at https://agile-chamber-7384.herokuapp.com/, so you can try out the above request by clicking this link: https://agile-chamber-7384.herokuapp.com/get-move?board=RNBQKBNR|PPPPPPPP|--------|--------|--------|--------|pppppppp|rnbqkbnr&color=white