summary refs log tree commit diff
path: root/src/routes/attachments.ts.disabled
diff options
context:
space:
mode:
authorxnacly <matteogropp@gmail.com>2020-12-30 22:49:01 +0100
committerxnacly <matteogropp@gmail.com>2020-12-30 22:49:01 +0100
commit82e63ef807cad85905df323b09b2ac0fb21bcb1a (patch)
tree2f0a09f42c40402e56e010447df6f560db6d505d /src/routes/attachments.ts.disabled
parentInitial commit (diff)
downloadserver-82e63ef807cad85905df323b09b2ac0fb21bcb1a.tar.xz
:sparkles: added crawler to cdn
Diffstat (limited to '')
-rw-r--r--src/routes/attachments.ts.disabled19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/routes/attachments.ts.disabled b/src/routes/attachments.ts.disabled
new file mode 100644

index 00000000..db1a7efc --- /dev/null +++ b/src/routes/attachments.ts.disabled
@@ -0,0 +1,19 @@ +import { Router } from "express"; +import multer from "multer"; +const multer_ = multer(); + +const router = Router(); +router.post("/:file", multer_.single("attachment"), async (req, res) => { + const { buffer } = req.file; + + res.set("Content-Type", "image/png"); + res.send(buffer); +}); +router.get("/:hash/:file", async (req, res) => { + res.send(`${req.params.hash}/${req.params.file}`); +}); +router.delete("/:hash/:file", async (req, res) => { + res.send("remove"); +}); + +export default router;