summary refs log tree commit diff
path: root/cdn/README.md
diff options
context:
space:
mode:
authorSamuel <34555296+Flam3rboy@users.noreply.github.com>2021-10-20 14:16:26 -0400
committerGitHub <noreply@github.com>2021-10-20 14:16:26 -0400
commit00fd55ed772b2afe5fdefe1e5395c29f15fc914f (patch)
treed97f134505a08d4930b70d459b2f1517c539ccfa /cdn/README.md
parentMerge branch 'master' of http://github.com/fosscord/fosscord-server (diff)
parentreplaced space with tabs (diff)
downloadserver-00fd55ed772b2afe5fdefe1e5395c29f15fc914f.tar.xz
Merge pull request #490 from developomp/master
Prettier format and link simplification
Diffstat (limited to '')
-rw-r--r--cdn/README.md27
1 files changed, 25 insertions, 2 deletions
diff --git a/cdn/README.md b/cdn/README.md

index 6cd6186a..7d8e99b0 100644 --- a/cdn/README.md +++ b/cdn/README.md
@@ -1,20 +1,26 @@ # Fosscord-CDN + CDN for Fosscord ## Run localy: + ``` npm i node dist/ ``` ## Endpoints: + ### POST `/attachments/<filename>` + ``` Content-Type: form-data attachment: File (binary-data) ``` + ##### Returns: + ``` { "success": boolean, // true @@ -23,20 +29,28 @@ attachment: File (binary-data) "filename": string // "lakdoiauej.png" } ``` + ### GET `/attachments/<id>/<filename>` + ``` requests image from database with given <id> and <filename> ``` + ##### Returns: + ``` Content-Type: image/<imageType(png,img,gif)> Image ``` + ### DELETE `/attachments/<id>/<filename>` + ``` deletes database entry ``` + ##### Returns: + ``` Content-Type: application/json @@ -49,7 +63,8 @@ Content-Type: application/json <hr> _(endpoints for crawler):_ -### POST `/external` + +### POST `/external` ``` requests crawling of `og:`metadata and the download of the `og:image` property @@ -59,7 +74,9 @@ Content-Type: application/json body: {"url": URL} // "https://discord.com" ``` + ##### Returns: + ``` Content-Type: application/json @@ -72,17 +89,23 @@ Content-Type: application/json "ogType": string // "website" } ``` + ### GET `/external/<id>/<filename>` -- requests cached crawled image + +- requests cached crawled image + ``` url-params: :id // aHR0cHM6Ly9kaXNjb3JkLmNvbQ== :filename // discord.png ``` + ``` /external/aHR0cHM6Ly9kaXNjb3JkLmNvbQ==/discord.png ``` + ##### Returns: + ``` Content-Type: image/<imageType(png,img,gif)> Image