]>
Commit | Line | Data |
---|---|---|
0a03fcd9 BW |
1 | # Dummy data |
2 | ||
cfd31b86 | 3 | This directory content makes possible to test custom services cards or create a demo without actually running the service. |
0a03fcd9 BW |
4 | The principle is simple: save a sample output of the API used in the service in a static file in this directory. The path must be identical as the service endpoint to be used seamlessly. |
5 | ||
70f583c3 BW |
6 | ## Start the mock server to expose dummy data |
7 | ||
8 | ```sh | |
9 | yarn mock | |
10 | ``` | |
11 | ||
cfd31b86 | 12 | ## How to add a new services sample |
0a03fcd9 | 13 | |
cfd31b86 | 14 | - create a directory for your service, and any sub-folder existing in the service api path. |
0a03fcd9 BW |
15 | - save the api output in a file named after the service endpoint. |
16 | ||
17 | Example: | |
cfd31b86 S |
18 | |
19 | ```sh | |
0a03fcd9 | 20 | mkdir pihole |
cfd31b86 S |
21 | curl http://my-pihole.me/admin/api.php -o pihole/api.php # /admin is omited because for PiHole, the implementation expect it to be in the base url (`url` or `endpoint` property) |
22 | ``` |