Is there a type in @types/express for Express middleware functions
Here is how I'm handling it:
import type { RequestHandler } from "express";
export const myMiddleware: RequestHandler = (req, res, next) => {
// HANDLE REQUEST
// RESPOND OR CALL NEXT()
};
Yes. You need to import also RequestHandler
. Check definition here
import { RequestHandler } from 'express';