const PASTE_URL: string = "https://paste.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 { const response = await fetch(`${PASTE_URL}/api/upload`, { method: "POST", body: content, }); const { id } = await response.json(); return `${PASTE_URL}/${id}`; }