File tree 2 files changed +31
-2
lines changed
2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,35 @@ Simple `image/jpeg` mime type rendered image on output.
15
15
16
16
## Usage
17
17
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 |
19
48
20
49
## Develop
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ const renderSVG = (board, {
111
111
. split ( '{{board}}' ) . join ( svgElements . join ( '' ) )
112
112
}
113
113
114
- app . get ( '/:fen.jpeg ' , ( req , res ) => {
114
+ app . get ( '/:fen.jpg ' , ( req , res ) => {
115
115
const {
116
116
debug = 0 ,
117
117
rotate = 0 ,
You can’t perform that action at this time.
0 commit comments