chore: update music api

This commit is contained in:
Cory Dransfeldt 2024-03-30 20:15:00 -07:00
parent bc5bf79e5c
commit 1dd48ddf68
No known key found for this signature in database
2 changed files with 22 additions and 13 deletions

View file

@ -1,13 +1,13 @@
import EleventyFetch from '@11ty/eleventy-fetch';
import { buildChart } from './helpers/music.js'
// import EleventyFetch from '@11ty/eleventy-fetch';
// import { buildChart } from './helpers/music.js'
export default async function () {
const API_KEY_MUSIC = process.env.API_KEY_MUSIC;
const url = `https://coryd.dev/api/music?key=${API_KEY_MUSIC}`;
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
}).catch();
const resObj = await res;
return buildChart(resObj['data'])
}
// export default async function () {
// const API_KEY_MUSIC = process.env.API_KEY_MUSIC;
// const url = `https://coryd.dev/api/music?key=${API_KEY_MUSIC}`;
// const res = EleventyFetch(url, {
// duration: '1h',
// type: 'json',
// }).catch();
// const resObj = await res;
// return buildChart(resObj['data'])
// }