0
0
mirror of https://github.com/yude-jp/yude.jp synced 2024-09-27 23:20:24 +09:00

Add console logging (for ease of debug)

This commit is contained in:
yude 2021-05-28 11:33:22 +09:00
parent 32064d4ba2
commit cd93e4691d
Signed by: yude
GPG Key ID: EB0FE5D925C4A968
2 changed files with 5 additions and 2 deletions

View File

@ -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")
}
}
};

View File

@ -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 } }
}