Skip to content

Latest commit

 

History

History
71 lines (46 loc) · 1.19 KB

README.md

File metadata and controls

71 lines (46 loc) · 1.19 KB

Envoy

Launches a proxy that saves API responses for frontend development. Can also return saved responses.

Install

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

Usage

  1. Add config options to package.json
    "envoy": {
      "port": 3001,
      "target": "https://localhost:3000",
      "routesPath": "./routes.js",
      "fileType": "es6",
      "saveResponse": true,
      "responsePath": "./mocks"
    },
  2. Run the server
    yarn run envoy

Point your app URL to http://localhost:3001

Configuration options

port (default: 3001)

The port which the server will run on

target (required)

The url which will be proxied

routesPath (required)

Local path to a routes file

fileType (default: es6)

Save responses in either es6 format or node

saveResponse (default: false)

Toggle saving responses to disk

responsePath (required if saveResponse is true)

Path to save responses