Getting Started with Deployment
(Uploading Files)

Getting Started with Deployment (Uploading Files)

·

2 min read

That is how you can prepare your React application for deployment, and how you can then deploy it, in this case, to Firebase as an example.

We wanna upload it to some hosting provider, to a real server, so that it is made available to visitors from all over the world.

A React SPA is a "Static Website" Client side = Browser side

A React App is a static website only HTML CSS & javaScript And therefore, when we want to deploy such a react single page application, we need a static side host.

How we find such a host ? Static website hosting provider

Using firebase for hosting:

1- Create a google account 2- Create a project "routehttp" 3- Go to Hosting 4- Get Started 5- npm install -g firebase-tools (Your app Terminal) 6- Set up firebase Hosting "next" 7- firebase login (Your app terminal) 8- firebase init (Your app terminal) now it will ask u a couple of questions -Select => Hosting: Configure and deploy...

  • Select => use an existing one...
  • select Your project "routehttp"

Ques: - what do you want to use as... answer : write => build

Configure as A Single page app ? Y automatic build... ? N file index overwrite... ? N

With that FireBase Deployment is configured

now run firebase deploy (terminal) So here, if I now run firebase deploy, that configuration will be used to now deploy our code in the build folder to Firebase. So now, this uploads our code, and once it's done, it even gives us a pointer at the URL where we can view our application.

Now, if you ever wanna take your page down, you can do this with the Firebase tool too. Here, I'll do it, and I'll run

firebase hosting : disable

Screenshot (491).png

Screenshot (489).png

Screenshot (490).png