res node code example
Example 1: node js response header
response.setHeader("Content-Type", "text/html");
Example 2: nodejs response is html not json data
// use this after route not before route
if (process.env.NODE_ENV === 'production') {
app.use(express.static(resolve(process.cwd(), 'client/build')))
app.get('*', (req, res) => {
res.sendFile(resolve(process.cwd(), 'client/build/index.html'))
})
}