Update README.md
This commit is contained in:
parent
631a1d80a0
commit
f1d63918ef
49
README.md
49
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==
|
||||
|
Loading…
x
Reference in New Issue
Block a user