1// use this after route not before route
2if (process.env.NODE_ENV === 'production') {
3 app.use(express.static(resolve(process.cwd(), 'client/build')))
4 app.get('*', (req, res) => {
5 res.sendFile(resolve(process.cwd(), 'client/build/index.html'))
6 })
7}