From 5e86d7ab9c5200d794c3adb2b422d20a2aefd2ce Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 13 Aug 2022 02:00:50 +0200 Subject: restructure to single project --- cdn/README.md | 112 ---------------------------------------------------------- 1 file changed, 112 deletions(-) delete mode 100644 cdn/README.md (limited to 'cdn/README.md') diff --git a/cdn/README.md b/cdn/README.md deleted file mode 100644 index 7d8e99b0..00000000 --- a/cdn/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# Fosscord-CDN - -CDN for Fosscord - -## Run localy: - -``` -npm i -node dist/ -``` - -## Endpoints: - -### POST `/attachments/` - -``` -Content-Type: form-data - -attachment: File (binary-data) -``` - -##### Returns: - -``` -{ - "success": boolean, // true - "message": string, // "attachment uploaded" - "id": snowflake, // "794183329158135808" - "filename": string // "lakdoiauej.png" -} -``` - -### GET `/attachments//` - -``` -requests image from database with given and -``` - -##### Returns: - -``` -Content-Type: image/ -Image -``` - -### DELETE `/attachments//` - -``` -deletes database entry -``` - -##### Returns: - -``` -Content-Type: application/json - -{ - "success": true, - "message": "attachment deleted" -} -``` - -
- -_(endpoints for crawler):_ - -### POST `/external` - -``` -requests crawling of `og:`metadata and the download of the `og:image` property --------- -Content-Type: application/json - -body: -{"url": URL} // "https://discord.com" -``` - -##### Returns: - -``` -Content-Type: application/json - -{ - "id": string, // "aHR0cHM6Ly9kaXNjb3JkLmNvbQ==" - "ogTitle": string, // "Discord | Your Place to Talk and Hang Out" - "ogDescription": string, // "Discord is the easiest way to talk over voice, video, and text. Talk, chat, hang out, and stay close with your friends and communities." - "cachedImage": string, // "/external/aHR0cHM6Ly9kaXNjb3JkLmNvbQ==/discord.png" - "ogUrl": string, // "https://discord.com/" - "ogType": string // "website" -} -``` - -### GET `/external//` - -- requests cached crawled image - -``` -url-params: - :id // aHR0cHM6Ly9kaXNjb3JkLmNvbQ== - :filename // discord.png -``` - -``` -/external/aHR0cHM6Ly9kaXNjb3JkLmNvbQ==/discord.png -``` - -##### Returns: - -``` -Content-Type: image/ -Image -``` -- cgit 1.5.1