@calvin_von/proxy-plugin-cache
v2.3.0
Published
A dalao-proxy plugin for cache response
Downloads
47
Maintainers
Readme
proxy-plugin-cache
A dalao-proxy for responses cache and mock.
only support dalao-proxy > 1.x
Usage
Install dalao-proxy
cli first
npm install -g dalao-proxy
Install plugin
globally
$ dalao-proxy plugin install -g @calvin_von/proxy-plugin-cache
locally
$ dalao-proxy plugin install -D @calvin_von/proxy-plugin-cache
Add config
- config for cache response
"cache": {
"dirname": ".dalao-cache",
"contentType": [
"application/json"
],
"maxAge": [
0,
"second"
],
"filters": [
{
"when": "response",
"where": "status",
"field": null,
"value": 200,
"custom": null,
"applyRoute": "*"
}
],
"logger": true
}
- config for mock feature
"mock": {
"dirname": "mocks",
"prefix": ""
}
Start proxy
$ dalao-proxy start
...
> npm run start
more docs about dalao-proxy
, see CalvinVon/dalao-proxy on Github.