mirror of
https://github.com/yude-jp/yude.jp
synced 2024-12-22 12:10:11 +09:00
Add console logging (for ease of debug)
This commit is contained in:
parent
32064d4ba2
commit
cd93e4691d
@ -17,8 +17,10 @@ function App ({data}){
|
||||
if (str.indexOf("game") !== -1){
|
||||
const yes_playing = t('yes_playing', {playing: data.members[0].game.name})
|
||||
return <p>{yes_playing}</p>
|
||||
console.log("[Discord API] Playing: " + data.members[0].game.name)
|
||||
}else{
|
||||
return <p></p>
|
||||
console.log("[Discord API] Nothing playing")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -16,17 +16,18 @@ function App ({data}) {
|
||||
const status = data.artist + ' - ' + data.title
|
||||
const listening = t('listening', {listening: status})
|
||||
return <p>{listening}</p>
|
||||
console.log("[Spotify Web API] Listening: " + status)
|
||||
}else{
|
||||
return <p></p>
|
||||
console.log("[Spotify Web API] Nothing listening")
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export async function getServerSideProps() {
|
||||
// Fetch data from external API
|
||||
const res = await fetch(url)
|
||||
const res = await fetch("/api/Spotify")
|
||||
const data = await res.json()
|
||||
|
||||
// Pass data to the page via props
|
||||
return { props: { data } }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user