Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Vue.js 2 and Bootstrap 4 Web Development

You're reading from   Vue.js 2 and Bootstrap 4 Web Development Build responsive SPAs with Bootstrap 4, Vue.js 2, and Firebase

Arrow left icon
Product type Paperback
Published in Sep 2017
Publisher Packt
ISBN-13 9781788290920
Length 310 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Olga Filipova Olga Filipova
Author Profile Icon Olga Filipova
Olga Filipova
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Please Introduce Yourself – Tutorial FREE CHAPTER 2. Under the Hood – Tutorial Explained 3. Let's Get Started 4. Let It Pomodoro! 5. Configuring Your Pomodoro 6. Please Authenticate! 7. Adding a Menu and Routing Functionality Using vue-router and Nuxt.js 8. Let's Collaborate – Adding New Workouts Using Firebase Data Storage and Vue.js 9. Test Test and Test 10. Deploying Using Firebase Index

Deploying your application

Well, now that we have a fully working application in our hands, it's time to make it public. In order to do this, we will deploy it to Firebase.

Start by installing Firebase tools:

npm install -g firebase-tools

Now, you have to tell your Firebase tools that you are actually a Firebase user who has an account. For this, you have to log in using Firebase tools. Run the following command:

firebase login

Follow the instructions to log in.

Now, you must initialize Firebase in your application. From the application root, call the following:

firebaseinit

You will be asked some questions. Select the third option for the first question:

Deploying your application

Select the Hosting option for the first question

Select the PleaseIntroduceYourself project from the list of projects to associate to the application.

Initialization is over. Check whether the file called firebase.json has been created in the project's folder. This file can contain an innumerous number of configurations. Check out the official Firebase documentation in this regard at https://firebase.google.com/docs/hosting/full-config. For us, the very basic indication of the public directory to be deployed would be enough. The directory where vue-cli builds the production-ready assets is called dist; therefore, we will want the content of this directory to be deployed. So, add the following line of code to your firebase.json file:

{
  "hosting": {
    "public": "dist",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

Do not forget to save your firebase.json file. Let's now build and deploy our application. Sounds like a big devops task, right? It's not really huge. Run npm build and then firebase deploy:

npm run build
firebase deploy

How difficult is it? After the successful deployment, Firebase will output the URL of your project. Now, you can start playing with it and send it to your friends. It's probably not the most beautiful URL in the world, right? Maybe you would like to connect it to your domain? Of course, it is possible!

You have been reading a chapter from
Vue.js 2 and Bootstrap 4 Web Development
Published in: Sep 2017
Publisher: Packt
ISBN-13: 9781788290920
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime