diff --git a/src/pages/app/[slug].astro b/src/pages/app/[slug].astro index 675c31a..6b9f15e 100644 --- a/src/pages/app/[slug].astro +++ b/src/pages/app/[slug].astro @@ -34,21 +34,24 @@ const { } = Astro.params -const apiUrl = `${ import.meta.env.PUBLIC_API_DOMAIN }/api/app/spotify.json` +const apiUrl = new URL( import.meta.env.PUBLIC_API_DOMAIN ) + +apiUrl.pathname = `/api/${ Astro.site.pathname }.json` + // Astro Request reference // https://docs.astro.build/en/reference/api-reference/#astrorequests console.log('Astro.params', Astro.params ) console.log('apiUrl', apiUrl ) -console.log('Astro.request', Object.keys( Astro.request ) ) console.log('Astro.request.url', Astro.request.url ) console.log('Astro.site.pathname', Astro.site.pathname ) +console.log('Astro.request', Astro.request ) -const appEntry = await axios.get(apiUrl) +const appEntry = await axios.get( apiUrl.toString() ) .then( response => { - console.log('response', response ) - return response.data + // console.log( 'response', response ) + return response.data.data })