Repository navigation
Expand file tree
/
Copy pathpages.js
More file actions
74 lines (73 loc) · 2.31 KB
/
Copy pathpages.js
File metadata and controls
74 lines (73 loc) · 2.31 KB
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
export default {
home: {
path: '/',
title: 'Home',
description: 'Demonstrated here is a simple page which all of its assets are fetched in parallel.'
},
'lorem-ipsum': {
path: '/lorem-ipsum',
title: 'Lorem Ipsum',
description:
"Demonstrated here is a large amount of static data that is fetched in parallel with all of the page's assets.",
data: [{ url: '/content/lorem-ipsum.json', static: true }]
},
pokemon: {
path: '/pokemon',
title: 'Pokémon',
description:
"Demonstrated here is dynamic data that is fetched in parallel with all of the page's assets and passed directly to its sub-pages.",
data: [
{
url: 'https://beta.pokeapi.co/graphql/v1beta',
method: 'post',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
query: `
query getAllPokemons {
pokemons: pokemon_v2_pokemonspecies(order_by: {id: asc}) {
name
id
extra: pokemon_v2_pokemons {
types: pokemon_v2_pokemontypes {
type: pokemon_v2_type {
name
}
}
sprites: pokemon_v2_pokemonsprites {
officialArtwrok: sprites(path: "other.official-artwork.front_default")
}
}
}
}
`
}),
preconnect: ['https://raw.githubusercontent.com']
}
]
},
'pokemon-info': {
path: '/pokemon/:name',
description: "Demonstrated here is dynamic path data that is fetched in parallel with all of the page's assets.",
data: [
{
url: ({ name }) => `https://pokeapi.co/api/v2/pokemon/${name}`,
preconnect: ['https://raw.githubusercontent.com']
},
{
url: ({ name }) => `https://pokeapi.co/api/v2/pokemon-species/${name}`
}
],
menuItem: false
},
comparison: {
path: '/comparison',
title: 'Comparison',
description:
'This page compares all rendering methods, listing their pros and cons.\nYou can click on each point to view a detailed explanation.'
},
'core-web-vitals': {
path: '/web-vitals',
title: 'Web Vitals',
description: 'This page specifies the values of core web vitals.'
}
}