I have a set of controller functions for my REST API and I\'m getting lots of the following
error TS7006: Parameter \'req\' implicitly has an \'any\' type.
The best way to do this is like so.
// create some shared types in your project
import { Request, Response, NextFunction } from 'express';
export type MiddlewareFn = (req: Request, res: Response, next: NextFunction) => void;
// then use the above types:
import {MiddlewareFn} from './my-types.d.ts'
router.get('/foo', function (req, res, next) {
// ....
});