-
Notifications
You must be signed in to change notification settings - Fork 1
/
venia-upward.yml
124 lines (112 loc) · 2.39 KB
/
venia-upward.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
status: response.status
headers: response.headers
body: response.body
response:
when:
- matches: request.url.pathname
pattern: '^/(graphql|rest|media/)'
use: proxy
- matches: request.url.pathname
pattern: '^/favicon.ico'
use: favicon
- matches: urlKey
pattern: '.'
use: appShell
- matches: request.url.pathname
pattern: '^/$'
use: appShell
default: static
proxy:
target: env.MAGENTO_BACKEND_URL
ignoreSSLErrors:
inline: true
appShell:
inline:
status:
when:
- matches: resource.model
pattern: '.'
use: 200
default: 404
headers:
inline:
content-type: 'text/html'
body:
engine: mustache
template: resource.template
provide:
model: resource.model
isDevelopment:
when:
- matches: env.NODE_ENV
pattern: 'development'
use:
inline: true
default:
inline: false
urlResolver: urlResolver
resource:
when:
- matches: urlResolver.type
pattern: 'PRODUCT'
use:
inline:
model: product
template: './templates/product-shell.mst'
- matches: urlResolver.type
pattern: '.'
use:
inline:
model: genericObject
template: './templates/generic-shell.mst'
default:
inline:
template: './templates/notfound-shell.mst'
urlResolver: urlResolverResult.data.urlResolver
urlResolverResult:
url: magentoGQL
query: './src/queries/urlResolver.graphql'
variables:
inline:
urlKey: request.url.pathname
magentoGQL:
engine: mustache
template:
inline: '{{env.MAGENTO_BACKEND_URL}}/graphql'
provide:
- env
product: productResult.data.productDetail.items.0
productResult:
url: magentoGQL
query: './src/queries/getProductDetail.graphql'
variables:
inline:
onServer:
inline: true
urlKey: urlKey
urlKey:
when:
- matches: request.url.pathname
pattern: '^/(?:(.*)\.html)?'
use: $match.$1
default:
inline: ''
genericObject:
inline:
name:
inline:
"Hello world!"
favicon:
inline:
status: 200
headers:
inline:
content-type:
inline: image/vnd.microsoft.icon
body:
file:
inline: ./media/favicon.ico
encoding: binary
static:
directory:
inline: './dist'