Get the osu! oauth token from MongoDB

I will likely use MongoDB for other things with this website in the future
This commit is contained in:
Taevas 2024-05-05 18:14:05 +02:00
parent 65884c0754
commit 0d9e4f6ed7
12 changed files with 109 additions and 45 deletions

View file

@ -1,5 +1,3 @@
import fetch from "node-fetch";
export async function api<T>(url: string, restful_token?: string): Promise<T> {
// eslint-disable-next-line @typescript-eslint/naming-convention
return (restful_token ? fetch(url, {headers: {"Authorization": `Bearer ${restful_token}`}}) : fetch(url))