Answer the question
In order to leave comments, you need to log in
I built a React project on vps, but the site is not displayed. Why?
Executed build of the project, placed 2 web-servers on different ports. The web server that should serve index.html is hosted on the default port :80. Wrote the code for issuing the page:
if(process.env.NODE_ENV === 'production') {
app.use('/', express.static(path.join(__dirname, 'client', 'build')))
app.get('*', (req,res) => {
res.sendFile(path.resolve((__dirname, 'client', 'build', 'index.html')))
})
}
Answer the question
In order to leave comments, you need to log in
Here the question is not to the hosting provider, but to yours, when will it update its DNS servers, and again, if you see just an empty page or some kind of error when you enter the domain?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question