HomeAbout Us
Deploy React App using Firebase Hosting
coding
Deploy React App using Firebase Hosting
Kevin Mustafa
Kevin Mustafa
August 03, 2021
1 min

In this tutorial, I will share how to deploy React Application using Firebase Hosting. First of all, make sure that you already have React Application project. If not you can follow this tutorial.

Install Firebase tools and login to Firebase

Next step, go to your React Application project directory and inside the directory, you will need to install the firebase tools using:

npm install firebase-tools -g

And then after that login into Firebase using:

firebase login

Initialize Firebase for React Application

After installing the Firebase tools and login into Firebase, proceed to initialize the Firebase inside your React Application project by using:

firebase init

You will get some questions and choices in the process, just follow the steps below:

Choose Hosting: Configure and deploy Firebase Hosting sites.

Choose Use and existing project and then choose your firebase project.

Follow all the answers like what I did in the screenshot above. You can answer differently if you really know what you are doing.

Now that you have successfully initialized firebase in your React application, inside firebase.json make sure that it looks like the following:

{
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

Deploying your React Application to Firebase Hosting

Now all you have to do is deploy your React Application into Firebase Hosting using:

firebase deploy

Firebase will give you a unique URL where your deployed React Application is hosted on. That is all, congratulations! You have successfully deployed your React Application using simple and secure (securely hosted using HTTPS) Firebase hosting. If you want to learn how to create Firebase Cloud Function you can follow the tutorial here.


Tags

#coding#developer#getting-started#nodejs#javascript#open-source#react#web-development#web-framework#typescript#tools
Kevin Mustafa

Kevin Mustafa

Indonesia

I am Kevin, nice to meet you.

Expertise

Related Posts

Top 7 Coding Challenges
Top 7 Coding Challenges
August 21, 2021
1 min
© 2021, All Rights Reserved.

Quick Links

About Us