A CLI tool to fetch and cache APIs as static files.
npm install -g api-cache-codegen
api-cache-process -c config.json
Replace api-cache-process
with the actual command to run the CLI tool and config.json
with the path to your configuration file.
Create a JSON configuration file, e.g., config.json
, with the following structure:
{
"$schema": "https://raw.githubusercontent.com/guanbinrui/api-cache-codegen/main/schema.json",
"version": 1,
"list": [
{
"$schema": "https://raw.githubusercontent.com/guanbinrui/api-cache-codegen/main/schema.json",
"input": "https://example.com/api.json",
"output": "./cache_generated/",
"generator": {
"src": "./generate_or_fetch_something.js",
"key": "api",
"ttl": 1800
}
}
]
}
This project is licensed under the MIT License - see the LICENSE file for details.