How to deploy an App on Google Firebase 🔥
In this tutorial, I am going to explain how to deploy an app on Firebase.
So, if do not have a clear idea on what Firebase is ? I would suggest going through the below link.
Step 01: Create an account on Firebase
Go to https://firebase.google.com/
Click on Go to console.
After logging in to your gmail account, you will be directed to the homepage.
There choose Create a project.
Then choose whatever your project/app name is, for example: my-demo-app.
Then you’ll be asked if you want to have Google analytics for your firebase project or not.
You can enable or disable the option as in the image below. Click on Create project.
Now that you have created your project in firebase, you will be directed to the below page. Click on continue.
Under the option Develop
select Hosting
.
You will be directed to a new page, click on Get Started
.
Step 02: Deploy your app
Now let’s connect our app with this project we created here.
Open your project app directory in terminal or command prompt and run these below commands:
npm install -g firebase-tools
// this will install the latest version of Firebase CLI.
firebase login
//log into your Google firebase account.
firebase init
//initiate your project.
There choose Hosting
from the options by navigating to it and pressing space-bar
key and then enter
. Again choose from existing project list
. Then on asking of public directory, write build
. Then a yes
and No
on the followed questions.
firebase deploy
//this will then give you the URL on which your app is hosted. (You can also customise that in the start where you were naming your project in firebase.google.com)
Congratulations 🎊 , Your app is now hosted 👏.