From e4fc61dc347cc54d81eded31000377ee9e78e888 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Mon, 31 May 2021 21:01:28 +0200 Subject: :zap: add explicit types to req and res --- src/routes/external.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/routes/external.ts') diff --git a/src/routes/external.ts b/src/routes/external.ts index dcf56c8c..3abe9c22 100644 --- a/src/routes/external.ts +++ b/src/routes/external.ts @@ -1,6 +1,6 @@ // @ts-nocheck import bodyParser from "body-parser"; -import { Router } from "express"; +import { Router, Response, Request } from "express"; import fetch from "node-fetch"; import crypto from "crypto"; import { HTTPError } from "lambert-server"; @@ -29,7 +29,7 @@ const DEFAULT_FETCH_OPTIONS: any = { method: "GET", }; -router.post("/", bodyParser.json(), async (req, res) => { +router.post("/", bodyParser.json(), async (req: Request, res: Response) => { if (req.headers.signature !== Config.get().security.requestSignature) throw new HTTPError("Invalid request signature"); if (!req.body) throw new HTTPError("Invalid Body"); @@ -50,7 +50,7 @@ router.post("/", bodyParser.json(), async (req, res) => { } }); -router.get("/:id/", async (req, res) => { +router.get("/:id/", async (req: Request, res: Response) => { const { id } = req.params; const file = await storage.get(`/external/${id}`); -- cgit 1.5.1