homer/dummy-data/README.md

23 lines
801 B
Markdown
Raw Permalink Normal View History

2022-10-11 17:19:50 +00:00
# Dummy data
This directory content makes possible to test custom services cards or create a demo without actually running the service.
2022-10-11 17:19:50 +00:00
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.
## Start the mock server to expose dummy data
```sh
2024-04-22 17:55:25 +00:00
pnpm mock
```
## How to add a new services sample
2022-10-11 17:19:50 +00:00
- create a directory for your service, and any sub-folder existing in the service api path.
2022-10-11 17:19:50 +00:00
- save the api output in a file named after the service endpoint.
Example:
```sh
2022-10-11 17:19:50 +00:00
mkdir pihole
2023-02-07 07:33:33 +00:00
curl http://my-pihole.me/admin/api.php -o pihole/api.php # /admin is omitted because for PiHole, the implementation expect it to be in the base url (`url` or `endpoint` property)
```