diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 49 |
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== |