The req variable of Request type has no intellisense for property body. Is this due to the typings?
import { Request, Response } from 'express'
import { ok, bad } from './responses'
export const signIn: async (req: Request, res: Response) => {
try {
const { name, pword } = req.body // body is not recognized
const data = auth.signIn(name, password)
ok(res, data)
} catch (error) {
bad(res, error)
}
}
bodyParser.json()
- is more common use case. – Gabo