user11277823
user11277823

Reputation:

How do I properly upload a localhost website online?

I have a ReactJS project for my Front and a NodeJS project/server using Express for my back. My Front depends on my Back because for example in the Login part, I ask the server if the user is already in our database.

To execute my project, I just open 2 terminals and do npm start in each Front and Back.

I know that in order to upload a website with a personal domain name, I should:

  1. Buy a domain name
  2. Pay a subscription to a web-hosting website like GoDaddy, Bluehost, Hostgator etc.

If I pay a subscription to some web-hosting website, will I be able to put my Front AND Back? I have seen some tutorials online and people just make a simple HTML/CSS/JS website and upload it. I never see anyone uploading their own Server and making requests to it.

I'm not asking to merge both my Front and Back. I want to know how do people upload online their React front and Node Server online, for them to be always executed and talking to each other. I just can't see the relationship and explanation on how uploading both.

Upvotes: 0

Views: 578

Answers (2)

f4z3k4s
f4z3k4s

Reputation: 1241

An easy solution for your use case could be digitalocean or any similar site that offers a whole virtual system to operate with. You can then ssh into the server as it was your computer and use the terminal there. It is cheaper than Heroku if you wish to make your site available without 30 seconds waiting time (that is what Heroku does in a serverless fashion if you are on a free plan). There are dozens of sites like this but I had good experience with digitalocean and a basic plan is $5/mo.

Upvotes: 0

xDreamCoding
xDreamCoding

Reputation: 1694

Your react frontend doesn't really need a server, you'd need to build a release bundle and that can be served from any static filehoster. For your backend though you need a node.js hoster like AWS or heroku, follow their tutorials to upload your project.

You could also then serve both from the same hoster and read into connecting frontend and backend like mentioned by @FedeSc

Upvotes: 1

Related Questions