Launches a proxy that saves API responses for frontend development. Can also return saved responses.
Note: Make sure you have a GitHub token set up with package registry access
Add .npmrc
to your root with:
@vas-dev:registry=https://npm.pkg.github.com
With yarn
:
yarn add --dev @vas-dev/envoy
With npm
:
npm install --save-dev @vas-dev/envoy
- Add config options to
package.json
"envoy": { "port": 3001, "target": "https://localhost:3000", "routesPath": "./routes.js", "fileType": "es6", "saveResponse": true, "responsePath": "./mocks" },
- Run the server
yarn run envoy
Point your app URL to http://localhost:3001
The port which the server will run on
The url which will be proxied
Local path to a routes file
Save responses in either es6
format or node
Toggle saving responses to disk
Path to save responses