Skip to content

Instantly share code, notes, and snippets.

@jahvi
Created April 3, 2019 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jahvi/2ac2e90492c07451612fc964baa0362c to your computer and use it in GitHub Desktop.
Save jahvi/2ac2e90492c07451612fc964baa0362c to your computer and use it in GitHub Desktop.
status: response.status # [Go to 1]
headers: response.headers # [Go to 1]
body: response.body # [Go to 1]
# 1
response:
when:
- matches: request.url.pathname
pattern: '^/pokemon/graphql'
use: pokemonGQL # [Go to 2]
- matches: request.url.pathname
pattern: '^/countries/graphql'
use: countriesGQL # [Go to 3]
default: helloWorld # [Go to 4]
# 2
pokemonGQL:
target:
inline: 'https://graphql-pokemon.now.sh'
# 3
countriesGQL:
target:
inline: 'https://countries.trevorblades.com'
# 4
helloWorld:
inline:
status: 200
headers:
inline:
content-type:
inline: text/html
body:
inline: 'Hello World'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment