Firebase - Deploying


Advertisements

In this chapter, we will show you how to host your app on the Firebase server.

Before we begin, let us just add some text to index.html body tag. In this example, we will add the following text.

<h1>WELCOME TO FIREBASE TUTORIALS APP</h1>

Step 1 - Install Firebase Tools

We need to install firebase tools globally in the command prompt window.

npm install -g firebase-tools

Step 2 - Initialize the Firebase App

First we need to login to Firebase in the command prompt.

firebase login

Open the root folder of your app in the command prompt and run the following command.

firebase init

This command will initialize your app.

NOTE − If you have used a default configuration, the public folder will be created and the index.html inside this folder will be the starting point of your app. You can copy your app file inside the public folder as a workaround.

Step 3 - Deploy Firebase App

This is the last step in this chapter. Run the following command from the command prompt to deploy your app.

firebase deploy

After this step, the console will log your apps Firebase URL. In our case, it is called https://tutorialsfirebase.firebaseapp.com. We can run this link in the browser to see our app.

Firebase Deploying
Advertisements