From 30e55d43c7a8623084a9c3de9ce04cd8d488a92e Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 23 Apr 2024 17:52:37 +0100 Subject: [PATCH] use my paste server --- src/app/common/hastebin.ts | 8 ++++---- src/app/components/code-highlighter.tsx | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/common/hastebin.ts b/src/app/common/hastebin.ts index 221a9d6..cf5cd1f 100644 --- a/src/app/common/hastebin.ts +++ b/src/app/common/hastebin.ts @@ -1,4 +1,4 @@ -const HASTE_URL: string = "https://haste.fascinated.cc"; +const HASTE_URL: string = "https://paste.fascinated.cc"; /** * Creates a new haste with the given content. @@ -7,11 +7,11 @@ const HASTE_URL: string = "https://haste.fascinated.cc"; * @returns the URL of the created haste */ export async function createHaste(content: string): Promise { - const response = await fetch(`${HASTE_URL}/documents`, { + const response = await fetch(`${HASTE_URL}/api/upload`, { method: "POST", body: content, }); - const { key } = await response.json(); - return `${HASTE_URL}/${key}`; + const { id } = await response.json(); + return `${HASTE_URL}/${id}`; } diff --git a/src/app/components/code-highlighter.tsx b/src/app/components/code-highlighter.tsx index e5237a5..0cb67da 100644 --- a/src/app/components/code-highlighter.tsx +++ b/src/app/components/code-highlighter.tsx @@ -77,6 +77,7 @@ export function CodeHighlighter({ code, language = "json", rounded = true }: Cod {capitalizeFirstLetter(language)} + {/* Code */}