add osu API

This commit is contained in:
2026-02-28 01:17:52 +01:00
parent 191ec08f7f
commit 290b9752a9
2 changed files with 133 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { json, error } from '@sveltejs/kit';
import { getBeatmap } from '$lib/server/osu/api';
import type { RequestHandler } from './$types';
export const GET: RequestHandler = async ({ params, locals }) => {
if (!locals.user) error(401, 'Not logged in');
try {
const beatmap = await getBeatmap(params.id);
return json(beatmap);
} catch {
error(404, 'Beatmap not found');
}
};