diff --git a/examples/snowpack/astro/pages/news.hmx b/examples/snowpack/astro/pages/news.hmx index cdccace95..f1350ed3f 100644 --- a/examples/snowpack/astro/pages/news.hmx +++ b/examples/snowpack/astro/pages/news.hmx @@ -9,7 +9,8 @@ import news from '../data/news.json'; import users from '../data/users.json'; - export function setup({ context, request }) { + export async function setup({ context, request, fetch }) { + const pokemonData = await fetch(`https://pokeapi.co/api/v2/pokemon/ditto`); return { context: { title: 'Community & News', @@ -18,6 +19,7 @@ // Add your project, organization, or company to the end of this list! news, users, + pokemonData: await pokemonData.json(), } } } @@ -37,6 +39,10 @@ Submit it!

+

+ In case you're curious, the best pokemon is {context.pokemonData.name}. +

+