This post originated from an RSS feed registered with Java Buzz
by Ross Mahony.
Original Post: Vue + Vuetify + Nuxt + Heroku
Feed Title: Monster Sandwich - Java, Spring, Hibernate, JPA, JEE, Scala
Feed URL: http://monstersandwich.blogspot.com/feeds/posts/default?alt=rss
Feed Description: A practical site with discussions on a wide range of Java topics where I have tried to include best practices. I try to include practical working examples that anyone can download, install and run. I would love to open discussion to other developers to collaborate with and to learn.
I want to learn how to build a SSR front-end application in Vue and have been playing around with Vuetify, Nuxt.js and Heroku. These are the steps I followed to get the Vuetify Nuxt.js starter template deployed to Heroku.
Create GitHub repository
I created a GitHub repository and cloned it to a directory on my local computer.
Initialise starter template
Before you begin make sure you have Node.js and vue-cli installed
Open a command prompt and change into the directory of your git project
Follow the instructions on the vuetify/nuxt github project
Install Heroku CLI
The Heroku Command Line Interface (CLI), formerly known as the Heroku Toolbelt, is a tool for creating and managing Heroku apps from the command line / shell of various operating systems.
You can create an Heroku App online or through the Command Line Interface. Follow these instructions to create your Heroku app.
Heroku Deployment Configuration
I followed the steps outlined in the Nuxt.js support web page for Heroku apps. Although it didn't quite work on deployment as npm start was not building the application. I changed the package.json script section to build and then run on start. Not sure if this is correct but it worked for me.
To deploy your application (via Git) to Heroku you should run the following command:
git push heroku master
finstall If you want to deploy code to Heroku from a non-master branch of your local repository use the following syntax to ensure it is pushed to the remote’s master branch, example:
git push heroku mybranch:master
Heroku Local
In your to troubleshoot your application you can use the following command to run locally:
heroku local
Node.js Support
The following page has some useful information for Node.js application running on Heroku.