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
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m29s
This commit is contained in:
17
src/app/common/hastebin.ts
Normal file
17
src/app/common/hastebin.ts
Normal 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}`;
|
||||
}
|
Reference in New Issue
Block a user