-
Notifications
You must be signed in to change notification settings - Fork 1
/
upward-ssr-styled.yml
64 lines (56 loc) · 1.22 KB
/
upward-ssr-styled.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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]
- matches: request.url.pathname
pattern: '^/(favicon.ico$|styles.css$)'
use: static # [Go to 8]
default: pokemon # [Go to 4]
# 2
pokemonGQL:
target: env.POKEMON_GRAPHQL_URL
# 3
countriesGQL:
target: env.COUNTRIES_GRAPHQL_URL
# 4
pokemon:
inline:
status: 200
headers:
inline:
content-type:
inline: text/html
body:
engine: mustache
template: './templates/pokemon.mst'
provide:
pokemonData: pokemonData # [Go to 5]
# 5
pokemonData: pokemonResult.data.pokemon # [Go to 6]
# 6
pokemonResult:
url: env.POKEMON_GRAPHQL_URL
query: './queries/getPokemonDetail.graphql'
variables:
inline:
pokemonName: pokemonName # [Go to 7]
# 7
pokemonName:
when:
- matches: request.url.pathname
pattern: '^/(?:(.*))?'
use: $match.$1
default:
inline: ''
# 8
static:
directory:
inline: './static'