add json upload button and add page reload button to server and player pages
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m29s

This commit is contained in:
Lee
2024-04-22 22:50:13 +01:00
parent 63e4eedc37
commit 1e96ed1b1c
7 changed files with 90 additions and 2 deletions

View File

@ -0,0 +1,17 @@
const HASTE_URL: string = "https://haste.fascinated.cc";
/**
* Creates a new haste with the given content.
*
* @param content the content to create the haste with
* @returns the URL of the created haste
*/
export async function createHaste(content: string): Promise<string> {
const response = await fetch(`${HASTE_URL}/documents`, {
method: "POST",
body: content,
});
const { key } = await response.json();
return `${HASTE_URL}/${key}`;
}