use my paste server
This commit is contained in:
parent
a0b8777a94
commit
30e55d43c7
@ -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}`;
|
||||
}
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user