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