V
V
Vadim_Sabirov2021-06-28 04:52:19
Express.js
Vadim_Sabirov, 2021-06-28 04:52:19

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

But when I click on the link, the page is not displayed.
A few hours ago, I performed a technical transfer of a domain from one hosting provider to another. It was written that it could be inactive for 24 hours, but the hosting provider's website says that the domain is active. Is this a problem with the domain transfer, and within 24 hours the site will be available, or am I doing something wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Masson, 2021-07-23
@pumbasl

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 question

Ask a Question

731 491 924 answers to any question