doesitarm/src/pages/app/[slug].astro
2022-04-25 22:38:47 -05:00

84 lines
1.7 KiB
Text

---
// Full Astro Component Syntax:
// https://docs.astro.build/core-concepts/astro-components/
import axios from 'axios'
import Layout from '../../layouts/default.astro'
import { makeLastUpdatedFriendly } from '~/helpers/parse-date'
import { getAppEndpoint } from '~/helpers/app-derived.js'
import LinkButton from '~/components/link-button.vue'
import AllUpdatesSubscribe from '~/components/all-updates-subscribe.vue'
import VideoRow from '~/components/video/row.vue'
// import appList from '~/static/app-list.json'
// export async function getStaticPaths () {
// return appList.map(app => {
// // console.log('app.slug', app.slug )
// return {
// params: {
// slug: app.slug
// }
// }
// })
// }
const {
slug
} = Astro.params
const apiUrl = `${ import.meta.env.PUBLIC_API_DOMAIN }/api/app/spotify.json`
const cookie = Astro.request.headers.get('cookie')
console.log('Astro.params', Astro.params )
console.log('apiUrl', apiUrl )
console.log('cookie', cookie )
const appEntry = await axios.get(apiUrl)
.then( response => {
console.log('response', response )
return response.data
})
// const {
// head,
// entry
// } = Astro.props
const app = {}
const hasMultipleAliases = false
const appDeviceSupport = []
const hasRelatedVideos = false
const relatedVideosRowHtml = []
const hasBundleIdentifiers = false
const lastUpdatedFriendly = null
---
<Layout
headTitle={ `${ appEntry.name } | Does It ARM` }
headDescription={ 'Test' }
>
{ slug }
<br>
<br>
{ JSON.stringify( cookie ) }
<br>
<br>
{ JSON.stringify( appEntry ) }
<AllUpdatesSubscribe />
<AllUpdatesSubscribe
client:visible
/>
</Layout>