Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/healeycodes/chessboard-representation-api

Node.js/Express microservice. Takes FEN string, returns its HTML chess board representation.
https://github.com/healeycodes/chessboard-representation-api

api chess chessboard chessboard-representation fen-string node

Last synced: 24 days ago
JSON representation

Node.js/Express microservice. Takes FEN string, returns its HTML chess board representation.

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/healeycodes/chessboard-representation-api.svg?branch=master)](https://travis-ci.org/healeycodes/chessboard-representation-api)

## Chessboard Representation API

An old project I brought back to life!

It was an experiment to create a general-use chessboard representation API. I kept the useful parts.

![alt text](https://github.com/healeycodes/show-chessboard-with-express/blob/master/public/img/example-board.png "Chessboard")

It's an example of a Node.js/Express/EJS wrapper around chessboard.js.

There are two routes, both of which accept a FEN string and return a page containing a chessboard.js representation of the FEN string in HTML/CSS/JavaScript. GET uses params, POST uses JSON.

 

Example FEN string: `r1bqkbnr/pppp1ppp/2n5/1B2p3/4P3/5N2/PPPP1PPP/RNBQK2R`

 

### Routes

GET: /api/fen/``

POST: /api/fen/`{"fen":""}`

 

### Tech Stack
Node.js/Express with EJS templates, chessboard.js.

Tested with Jest and SuperTest. Added Travis CI (06/19).

 

### Install

```npm install```

### Run

```node .\server.js```

### Test

```npm test```