add basic player page
Some checks failed
Deploy App / docker (ubuntu-latest) (push) Has been cancelled

This commit is contained in:
Lee
2024-04-14 19:55:07 +01:00
parent 89c534ac86
commit 8203b10b71
12 changed files with 308 additions and 9 deletions

6
src/common/utils.ts Normal file
View File

@ -0,0 +1,6 @@
import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}

18
src/common/web-request.ts Normal file
View File

@ -0,0 +1,18 @@
import { API_ENDPOINT } from "@/consts";
import axios from "axios";
export default class WebRequest {
private API_ENDPOINT: string = API_ENDPOINT;
/**
* Gets a response from the server
*
* @param endpoint the endpoint to send the request to
* @returns the response from the server
*/
public static get(endpoint: string) {
return axios.get(API_ENDPOINT + endpoint, {
validateStatus: () => true, // Do not throw an error on non-200 status codes
});
}
}