Check out example codes for "nodejs response is html not json data". It will help you in understanding the concepts better.

Code Example 1

// 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'))
  })
}

Learn ReactJs, React Native from akashmittal.com