Skip to content

Commit 6e13992

Browse files
committed
Updated README
1 parent 415fa9f commit 6e13992

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

README.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,35 @@ Simple `image/jpeg` mime type rendered image on output.
1515

1616
## Usage
1717

18-
18+
Start:
19+
20+
```sh
21+
npm run dev
22+
```
23+
24+
#### URL structure
25+
26+
```js
27+
const fen = 'rnbkqbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBKQBNR'
28+
29+
const url = `http://localhost:3001/${fen}.jpg?${queryString}`
30+
```
31+
32+
#### Query parameters
33+
34+
| Name | Type | Default | Description |
35+
| ---------------- | -------- | ---------- | ----------- |
36+
| **debug** | `number` | `0` | Turns on pure SVG markup |
37+
| **rotate** | `number` | `0` | Turns board to from black side view |
38+
| **arrows** | `array` | `[]` | The array of arrows `/(?<fromFile>[a-h])(?<fromRank>\d)(?<toFile>[a-h])(?<toRank>\d)(?<color>[0-9a-f]{3,8})?/` |
39+
| **marks** | `string` | `''` | The comma separated list of mark/cross on piece |
40+
| **board_size** | `number` | `512` | Outer board size |
41+
| **marks_size** | `number` | `5` | Size of marks on pieceless squares |
42+
| **bg_color** | `string` | `212121` | Color of the background (the border around squares) of the board |
43+
| **text_color** | `string` | `e5e5e5` | Color of text around the board |
44+
| **cross_color** | `string` | `ff2500` | Color of cross fill |
45+
| **marks_color** | `string` | `aaa23b` | Color of marks on pieceless squares |
46+
| **b_cell_color** | `string` | `b58863` | Color of black square |
47+
| **w_cell_color** | `string` | `f0d9b5` | Color of white square |
1948

2049
## Develop

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const renderSVG = (board, {
111111
.split('{{board}}').join(svgElements.join(''))
112112
}
113113

114-
app.get('/:fen.jpeg', (req, res) => {
114+
app.get('/:fen.jpg', (req, res) => {
115115
const {
116116
debug = 0,
117117
rotate = 0,

0 commit comments

Comments
 (0)