-1

I have a domain name which i want to link to my react project. The project has no node.js and express dependency.It is purely react project.I have deployed it in the node.js server.

How to map the domain name to pure react project??

Nah
  • 1,690
  • 2
  • 26
  • 46
Pawan Pandey
  • 21
  • 1
  • 5
  • Where have you deployed your `react` project? – Nah Feb 20 '18 at 15:31
  • In the node.js server. – Pawan Pandey Feb 21 '18 at 05:04
  • Node.js is underlying server language on which 'react' application runs. Moreover, 'react' is just JavaScript so it can run on any server. Basically my question was regarding hosting provider, where you are going to host. E.g. Firebase? Herokuapp.com? BlueHost? AWS? Or some other host? – Nah Feb 21 '18 at 08:27

2 Answers2

0

A React app is just a compiled JS and a base HTML file.

You have to deploy on your server all your compiled files (bundle.js) and the corresponding index.html.

Generally on servers

/www/index.html
/www/bundle.js
Alexis
  • 5,681
  • 1
  • 27
  • 44
  • I have deployed my react project onto the node server.I am able to start the project but when i am trying to access it through domain name it is throwing invalid host header error in browser. – Pawan Pandey Feb 21 '18 at 05:30
  • 1
    @PawanPandey So it's not a React issue but a server issue with mapping your domain – Alexis Feb 21 '18 at 08:18
0

You can map or configure domain name in your deployed host. In every Host Provider there are options given to map or configure the domain name.

As a side note react is just a javascript like html which just renders in your browser page, has nothing to do with domain name mapping or on server side.

Nah
  • 1,690
  • 2
  • 26
  • 46