use my paste server

This commit is contained in:
Lee 2024-04-23 17:52:37 +01:00
parent a0b8777a94
commit 30e55d43c7
2 changed files with 5 additions and 4 deletions

View File

@ -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<string> {
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}`;
}

View File

@ -77,6 +77,7 @@ export function CodeHighlighter({ code, language = "json", rounded = true }: Cod
<span className="text-xs text-muted-foreground">{capitalizeFirstLetter(language)}</span>
</div>
{/* Code */}
<SyntaxHighlighter
className={cn("max-h-[600px] !bg-secondary break-all rounded-md", rounded && "rounded-md")}
language={language}