From 3fc8855eb876e70f1fc032f22f7208092a0d577b Mon Sep 17 00:00:00 2001 From: xnacly Date: Wed, 30 Dec 2020 14:21:52 +0100 Subject: Initial commit --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 00000000..c7095453 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# discord-cdn +cdn for discord clone -- cgit 1.5.1 From 4ad77092d07159ebcf5ada40e49aa17fade1fe04 Mon Sep 17 00:00:00 2001 From: xnacly Date: Wed, 30 Dec 2020 23:07:11 +0100 Subject: Update README.md --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index c7095453..3439a95d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ # discord-cdn cdn for discord clone + +## Endpoints: + +### /external +#### POST +``` +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" + "ogDescription": string, // "Discord is the easiest way to talk over voice, video, and text. Talk, chat, hang out, and stay close with your friends and communities." + "cachedImage": string, // "/external/aHR0cHM6Ly9kaXNjb3JkLmNvbQ==/discord.png" + "ogUrl": string, // "https://discord.com/" + "ogType": string // "website" +} +``` +### /external/:id/:filename +#### GET -- cgit 1.5.1 From 738d78ca5a5d21f6dbbc7e7ebe72ccd883d388c0 Mon Sep 17 00:00:00 2001 From: xnacly Date: Wed, 30 Dec 2020 23:14:04 +0100 Subject: Update README.md --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 3439a95d..ede9cb5c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ cdn for discord clone ## Endpoints: -### /external +### `/external` #### POST ``` Content-Type: application/json @@ -23,5 +23,17 @@ Content-Type: application/json "ogType": string // "website" } ``` -### /external/:id/:filename +### `/external//` #### GET +``` +url-params: + :id // aHR0cHM6Ly9kaXNjb3JkLmNvbQ== + :filename // discord.png + +/external/aHR0cHM6Ly9kaXNjb3JkLmNvbQ==/discord.png +``` +##### Returns: +``` +Content-Type: image/ +Image +``` -- cgit 1.5.1 From 4edda3503dc1c075b1a50cf94c6e2a5ba6016d90 Mon Sep 17 00:00:00 2001 From: xnacly Date: Wed, 30 Dec 2020 23:17:45 +0100 Subject: Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index ede9cb5c..c6a5f2f9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ Content-Type: application/json url-params: :id // aHR0cHM6Ly9kaXNjb3JkLmNvbQ== :filename // discord.png - +``` +``` /external/aHR0cHM6Ly9kaXNjb3JkLmNvbQ==/discord.png ``` ##### Returns: -- cgit 1.5.1 From 316847094ea9c5d7d6e0e23aea0313b305cc8659 Mon Sep 17 00:00:00 2001 From: xnacly Date: Wed, 30 Dec 2020 23:18:05 +0100 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index c6a5f2f9..68cc50da 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# discord-cdn +# Discord-CDN cdn for discord clone ## Endpoints: -- cgit 1.5.1 From f1d63918efe1559137e14ee1252bf19152d4925e Mon Sep 17 00:00:00 2001 From: xnacly Date: Thu, 31 Dec 2020 13:54:40 +0100 Subject: Update README.md --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to 'README.md') 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/` +#### POST +``` +Content-Type: form-data +attachment: File +``` +##### Returns: +``` +{ + "success": boolean, // true + "message": string, // "attachment uploaded" + "id": snowflake, // "794183329158135808" + "filename": string // "lakdoiauej.png" +} +``` +### `/attachments//` +#### GET +``` +requests image from database with given and +``` +##### Returns: +``` +Content-Type: image/ +Image +``` +### `/attachments//` +#### DELETE +``` +deletes database entry +``` +##### Returns: +``` +Content-Type: application/json + +{ + "success": true, + "message": "attachment deleted" +} +``` + +
+ +_(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//` #### GET +- requests cached crawled image ``` url-params: :id // aHR0cHM6Ly9kaXNjb3JkLmNvbQ== -- cgit 1.5.1 From b9d40cbca0c91fd3f42d42a47496e0f16e5ebe38 Mon Sep 17 00:00:00 2001 From: xnacly Date: Thu, 31 Dec 2020 13:55:28 +0100 Subject: Update README.md --- README.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index ec28d6d5..491db0c0 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ cdn for discord clone ## Endpoints: -### `/attachments/` -#### POST +### POST `/attachments/` ``` Content-Type: form-data @@ -18,8 +17,7 @@ attachment: File "filename": string // "lakdoiauej.png" } ``` -### `/attachments//` -#### GET +### GET `/attachments//` ``` requests image from database with given and ``` @@ -28,8 +26,7 @@ requests image from database with given and Content-Type: image/ Image ``` -### `/attachments//` -#### DELETE +### DELETE `/attachments//` ``` deletes database entry ``` @@ -46,8 +43,8 @@ Content-Type: application/json
_(endpoints for crawler):_ -### `/external` -#### POST +### POST `/external` + ``` requests crawling of `og:`metadata and the download of the `og:image` property -------- @@ -69,8 +66,7 @@ Content-Type: application/json "ogType": string // "website" } ``` -### `/external//` -#### GET +### GET `/external//` - requests cached crawled image ``` url-params: -- cgit 1.5.1 From f971d83785ff0bf31568aaa3ba955c4df012216e Mon Sep 17 00:00:00 2001 From: xnacly Date: Thu, 31 Dec 2020 13:56:35 +0100 Subject: Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 491db0c0..9747e175 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ cdn for discord clone ``` Content-Type: form-data -attachment: File +attachment: File (binary-data) ``` ##### Returns: ``` -- cgit 1.5.1 From 2e4e7b826d3a5b2eeaa7e12c188dbf2393221093 Mon Sep 17 00:00:00 2001 From: xnacly Date: Thu, 31 Dec 2020 13:57:48 +0100 Subject: Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 9747e175..d34bd264 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ # Discord-CDN cdn for discord clone +## Run localy: +``` +npm i +node dist/ +``` + ## Endpoints: ### POST `/attachments/` ``` -- cgit 1.5.1 From d7a45bb0d625834e3e72f34cf643f700220d3659 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 9 Feb 2021 10:00:35 +0100 Subject: Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index d34bd264..6cd6186a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Discord-CDN -cdn for discord clone +# Fosscord-CDN +CDN for Fosscord ## Run localy: ``` -- cgit 1.5.1