is it possible to declare the types for the request body? I want to return bad request if the body contains other properties than the declared ones
import express from 'express'
const app = express()
app.use(express.json())
interface CustomRequest extends express.Request{
body:{
name:string
}
}
app.post('/t', (req: CustomRequest, res: express.Response) => {
res.send("hello world")
})
app.listen(5000, () => {
console.log("app listening on 5000")
})