3 ms·
Say you have an API endpoint: router.post('/users', (req, res) => { const body = req.body as MyEndpointInterface }) If someone posts to that end
by mikewhy 9y ago
Say you have an API endpoint:
router.post('/users', (req, res) => {
const body = req.body as MyEndpointInterface
})
If someone posts to that endpoint with the wrong interface, you're still going to have problems. I'm not sure of any language that would catch such a thing at compile-time and not need some sort of test.