Cleanup map api endpoint

This commit is contained in:
Liam 2022-10-19 17:00:19 +01:00
parent 5c117dc216
commit aa11262e3f

@ -11,13 +11,9 @@ export default async function handler(req, res) {
const data = { const data = {
// The maps data from the provided map hash // The maps data from the provided map hash
bsr: mapData.id, bsr: mapData.id,
songArt: songArt: `http://${req.headers.host}/api/beatsaver/art/${mapHash}?ext=${
"http://" + mapData.versions[0].coverURL.split("/")[3].split(".")[1]
req.headers.host + }`,
"/api/beatsaver/art/" +
mapHash +
"?ext=" +
mapData.versions[0].coverURL.split("/")[3].split(".")[1],
}; };
res.json({ error: false, data: data }); res.json({ error: false, data: data });
} }