Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Vue.js 2

You're reading from   Learning Vue.js 2 Learn how to build amazing reactive web applications easily with Vue.js

Arrow left icon
Product type Paperback
Published in Dec 2016
Publisher Packt
ISBN-13 9781786469946
Length 334 pages
Edition 1st Edition
Languages
Tools
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 (11) Chapters Close

Preface 1. Going Shopping with Vue.js FREE CHAPTER 2. Fundamentals ā€“ Installing and Using 3. Components ā€“ Understanding and Using 4. Reactivity ā€“ Binding Data to Your Application 5. Vuex ā€“ Managing State in Your Application 6. Plugins ā€“ Building Your House with Your Own Bricks 7. Testing ā€“ Time to Test What We Have Done So Far! 8. Deploying ā€“ Time to Go Live! 9. What Is Next? A. Solutions to Exercises

Deploying the shopping list application


In order to deploy our shopping list application, we need to perform exactly the same steps as we have done with the Pomodoro application.

Create a new application on your Heroku dashboard and connect it to your GitHub shopping list project. After that, copy the server.js file from the Pomodoro application, deal with the dependencies in the package.json file, and create postinstall and start scripts.

However, we still have one step left. Do not forget about our backend server that serves the REST API for the shopping lists. We need to run it as well.

Or even better, why do we need to run two servers if we can have just one server that does everything? We can integrate our JSON server with our express server by providing it the routing path to serve the shopping list endpoint, let's say api. Open the server.js file, import theĀ jsonServer dependency there, and tell the express app to use it. So, your server.js file will look like the following:

//server...
lock icon The rest of the chapter is locked
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
Banner background image