This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const { middleware } = require('@magento/upward-js'); | |
async function serve() { | |
const app = express(); | |
const port = 8000; | |
app.get('/', (req, res) => res.send('Hello from Express!')); | |
const upwardMiddleware = await middleware(`${__dirname}/upward.yml`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query($pokemonName: String) { | |
pokemon(name: $pokemonName) { | |
name | |
image | |
types | |
weight { | |
minimum | |
maximum | |
} | |
height { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="{{pokemonData.image}}" /><br/> | |
<strong>Name:</strong> {{pokemonData.name}}<br/> | |
<strong>Type:</strong> | |
{{#pokemonData.types}} | |
{{.}} | |
{{/pokemonData.types}} | |
<br/> | |
<strong>Height:</strong> | |
{{pokemonData.height.minimum}} - {{pokemonData.height.maximum}}<br/> | |
<strong>Weight:</strong> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
status: 200 | |
headers: | |
inline: | |
content-type: | |
inline: text/html | |
body: | |
inline: 'Hello World' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createUpwardServer } = require('@magento/upward-js'); | |
async function serve() { | |
await createUpwardServer({ | |
port: 8000, | |
bindLocal: true, | |
logUrl: true, | |
upwardPath: './upward-hello.yml' | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div | |
class="product relative align-center w-100 pb20" | |
v-observe-visibility="visibilityChanged" | |
> | |
<wishlist-button class="wishlist-button" :product="product" /> | |
<!-- ... --> | |
</div> | |
</template> |