Answer the question
In order to leave comments, you need to log in
Why is res.header not being set?
Can't display res.header('Content-type', 'application/json')
Tried
app.use((req, res, next) => {
res.header('Content-type', 'application/json')
next()
})
app.get('/pets', (req, res) => {
res.header('Content-type', 'application/json')
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question