summary refs log tree commit diff
path: root/src/routes/attachments.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-31 21:01:28 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-31 21:01:28 +0200
commite4fc61dc347cc54d81eded31000377ee9e78e888 (patch)
treeb25e31840197801cfb601292001a7b119ff0d9a5 /src/routes/attachments.ts
parent:sparkles: start.ts file (diff)
downloadserver-e4fc61dc347cc54d81eded31000377ee9e78e888.tar.xz
:zap: add explicit types to req and res
Diffstat (limited to '')
-rw-r--r--src/routes/attachments.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/routes/attachments.ts b/src/routes/attachments.ts

index e99b8d87..2e635b43 100644 --- a/src/routes/attachments.ts +++ b/src/routes/attachments.ts
@@ -1,4 +1,4 @@ -import { Router } from "express"; +import { Router, Response, Request } from "express"; import { Config, Snowflake } from "@fosscord/server-util"; import { storage } from "../util/Storage"; import FileType from "file-type"; @@ -8,7 +8,7 @@ import imageSize from "image-size"; const router = Router(); -router.post("/:channel_id", multer.single("file"), async (req, res) => { +router.post("/:channel_id", multer.single("file"), async (req: Request, res: Response) => { if (req.headers.signature !== Config.get().security.requestSignature) throw new HTTPError("Invalid request signature"); @@ -44,7 +44,7 @@ router.post("/:channel_id", multer.single("file"), async (req, res) => { return res.json(file); }); -router.get("/:channel_id/:id/:filename", async (req, res) => { +router.get("/:channel_id/:id/:filename", async (req: Request, res: Response) => { const { channel_id, id, filename } = req.params; const file = await storage.get(`attachments/${channel_id}/${id}/${filename}`); @@ -56,7 +56,7 @@ router.get("/:channel_id/:id/:filename", async (req, res) => { return res.send(file); }); -router.delete("/:channel_id/:id/:filename", async (req, res) => { +router.delete("/:channel_id/:id/:filename", async (req: Request, res: Response) => { if (req.headers.signature !== Config.get().security.requestSignature) throw new HTTPError("Invalid request signature");