summary refs log tree commit diff
diff options
context:
space:
mode:
authorxnacly <matteogropp@gmail.com>2020-12-31 13:54:40 +0100
committerGitHub <noreply@github.com>2020-12-31 13:54:40 +0100
commitf1d63918efe1559137e14ee1252bf19152d4925e (patch)
treec747e718a8b35c082002ca1765f5bc3c76744c65
parentfinished cdn (POST, GET, DELETE) (diff)
downloadserver-f1d63918efe1559137e14ee1252bf19152d4925e.tar.xz
Update README.md
-rw-r--r--README.md49
1 files changed, 48 insertions, 1 deletions
diff --git a/README.md b/README.md

index 68cc50da..ec28d6d5 100644 --- a/README.md +++ b/README.md
@@ -2,18 +2,64 @@ cdn for discord clone ## Endpoints: +### `/attachments/<filename>` +#### POST +``` +Content-Type: form-data +attachment: File +``` +##### Returns: +``` +{ + "success": boolean, // true + "message": string, // "attachment uploaded" + "id": snowflake, // "794183329158135808" + "filename": string // "lakdoiauej.png" +} +``` +### `/attachments/<id>/<filename>` +#### GET +``` +requests image from database with given <id> and <filename> +``` +##### Returns: +``` +Content-Type: image/<imageType(png,img,gif)> +Image +``` +### `/attachments/<id>/<filename>` +#### DELETE +``` +deletes database entry +``` +##### Returns: +``` +Content-Type: application/json + +{ + "success": true, + "message": "attachment deleted" +} +``` + +<hr> + +_(endpoints for crawler):_ ### `/external` #### POST ``` +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 -```ts + { "id": string, // "aHR0cHM6Ly9kaXNjb3JkLmNvbQ==" "ogTitle": string, // "Discord | Your Place to Talk and Hang Out" @@ -25,6 +71,7 @@ Content-Type: application/json ``` ### `/external/<id>/<filename>` #### GET +- requests cached crawled image ``` url-params: :id // aHR0cHM6Ly9kaXNjb3JkLmNvbQ==