I am serving a React app in express. My code here works locally:
// Serve React build
app.use(express.static('build'))
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'build', 'index.html'))
})
This also works on several other websites that I am hosting, however the difference with this one is that is on a subdomain rather than a regular domain. I also notice, however, that my other API routes work as so:
// API router
app.use('/api', apiRouter)
Anyone with answers would be greatly appreciated.