mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Add initial app endpoint
This commit is contained in:
parent
c1991e5f2a
commit
48c0afcaa6
1 changed files with 78 additions and 0 deletions
78
src/pages/app/[slug].astro
Normal file
78
src/pages/app/[slug].astro
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
---
|
||||
// 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.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 ) }
|
||||
</Layout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue