The backend for Paste. https://paste.fascinated.cc
This repository has been archived on 2024-06-10. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Liam 3d4dae9515
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 2m10s
Publish Docker Image / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 56s
fix xml?
2024-06-08 01:53:22 +01:00
.gitea/workflows Update s4u/setup-maven-action action to v1.13.0 2024-05-17 19:01:14 +00:00
src fix xml? 2024-06-08 01:53:22 +01:00
.gitignore add logs 2024-04-23 00:46:39 +01:00
Dockerfile Update maven Docker tag to v3.9.7 2024-05-28 21:01:17 +00:00
LICENSE add license 2024-04-24 21:28:01 +01:00
pom.xml add html compression 2024-06-02 10:20:10 +01:00
README.md add readme 2024-06-05 12:03:10 +01:00
renovate.json Add renovate.json 2024-04-23 15:00:40 +00:00

Paste

A simple pastebin service. Running at paste.fascinated.cc.

Javascript Utility

/**
 * Uploads a paste to paste.fascinated.cc
 *
 * @param content the content of the paste
 * @returns the paste key and the URL
 */
async function uploadPaste(content: string) {
  const response = await fetch("https://paste.fascinated.cc/api/upload", {
    method: "POST",
    body: content,
  });
  const json = await response.json();

  if (!response.ok) {
    throw new Error(json.message);
  }

  return {
    ...json,
    url: `https://paste.fascinated.cc/${json.key}`,
  };
}

console.log(await uploadPaste("Hello, World!"));