This repository has been archived on 2023-11-06. You can view files and clone it, but cannot push or open issues or pull requests.
beatsaber-overlay/pages/api/beatsaver/map.js

16 lines
412 B
JavaScript

import { getMapData } from "../../../src/helpers/beatSaverHelpers";
export default async function handler(req, res) {
const mapHash = req.query.hash;
const mapData = await getMapData(mapHash);
if (mapData === undefined) {
// Check if a map hash was provided
return res.status(404).json({
status: 404,
message: "Unknown Map Hash",
});
}
res.status(200).json({ status: "OK", data: mapData });
}