Deploy App

This article explains how to deploy your Express.js application live in your own production environment.


Prerequisites

This guide assumes you have already completed all of the steps in Install Prismic.

Before you proceed, you'll need to have installed Git and the Heroku CLI on your computer.

Initialize a Git repository and commit your changes

Before you can deploy your app to Heroku, you need to initialize your folder as a Git repository and commit your application code to the Git repository.

Copy
# Initialize an empty Git repository
git init

# Stage and commit the most recent work on the main or master branch
git add .
git commit -m 'Write a clear meaningful commit message here'

Deploy the app to Heroku

You can deploy your app to a live production environment with Heroku. If you don't already have one, create a Heroku account., Then log in to Heroku from the terminal:

Copy
heroku login

Create a new Heroku application:

Copy
heroku create

Add Heroku as a git remote, so you can push your project to Heroku:

Copy
# Add Heroku remote
heroku git:remote -a <name-of-the-newly-created-app>

# Check the remotes available
# Newly added `heroku` remote repository connection should be shown
git remote -v

Deploy your project to Heroku:

Copy
# Push the commit and update the deployed version on Heroku
git push heroku master

Open the app in the browser:

Copy
# Open the app in the browser
heroku open

Now your site is online!


Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Spot an error in the documentation? Get in touch with us on our Community Forum or using the feedback form above.