From 05277bc5649e42ac8e7f1d38dc474fad0acd738c Mon Sep 17 00:00:00 2001 From: developomp Date: Wed, 20 Oct 2021 09:14:48 +0900 Subject: prettier formatted /cdn --- cdn/README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'cdn/README.md') 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/` + ``` 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//` + ``` requests image from database with given and ``` + ##### Returns: + ``` Content-Type: image/ Image ``` + ### DELETE `/attachments//` + ``` deletes database entry ``` + ##### Returns: + ``` Content-Type: application/json @@ -49,7 +63,8 @@ Content-Type: application/json
_(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//` -- requests cached crawled image + +- requests cached crawled image + ``` url-params: :id // aHR0cHM6Ly9kaXNjb3JkLmNvbQ== :filename // discord.png ``` + ``` /external/aHR0cHM6Ly9kaXNjb3JkLmNvbQ==/discord.png ``` + ##### Returns: + ``` Content-Type: image/ Image -- cgit 1.5.1