aboutsummaryrefslogtreecommitdiff
path: root/src/lib/api.ts
blob: 01960c425788f9da7e68b72f3f39dd64996bcbd4 (plain)
1
2
3
4
5
6
7
8
9
// the trailing slash is required
export const API_URL = 'https://skyblock-api.matdoes.dev/'
// export const API_URL = 'http://localhost:8080/'

export async function fetchApi(path: string, fetch: (info: RequestInfo, init?: RequestInit | undefined) => Promise<Response>, init?: RequestInit | undefined) {
	// the header is set in hooks.server.ts
	const response = await fetch(API_URL + path, init)
	return response
}