Skip to content
Branch: master
Find file History

Latest commit

Latest commit b23f2d6 Dec 3, 2019

Files

Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md docs: add heroku server guide Dec 3, 2019
package.json docs: add heroku server guide Dec 3, 2019
server.js docs: add heroku server guide Dec 3, 2019

README.md

Heroku-based LHCI Server

Overview

The LHCI server can be run in any node environment with persistent disk storage or network access to a postgres database. Heroku offers a free tier of hosting that provides exactly this!

Setting Up Your Repo

# Create a directory and repo for your heroku project
mkdir lhci-heroku && cd lhci-heroku && git init
# Setup the LHCI files
curl https://raw.githubusercontent.com/GoogleChrome/lighthouse-ci/master/docs/recipes/heroku-server/package.json > package.json
curl https://raw.githubusercontent.com/GoogleChrome/lighthouse-ci/master/docs/recipes/heroku-server/server.js > server.js
# Create the project's first commit
git add -A && git commit -m 'Initial commit'

Setting Up Heroku

This assumes you've already signed up, created a heroku account, and installed the heroku CLI.

# Create a new project on heroku
heroku create
# Add a free database to your project
heroku addons:create heroku-postgresql:hobby-dev
# Deploy your code to heroku
git push heroku master
# Ensure heroku is running your app and open the URL
heroku ps:scale web=1
heroku open

Updating LHCI

Updates are made to the LHCI server from time to time and you'll want to keep up! You can update your LHCI server on Heroku just by pushing a commit.

# Update LHCI
npm install --save @lhci/server@latest
# Create a commit with your update
git add -A && git commit -m 'update LHCI'
# Deploy your update to heroku
git push heroku master
You can’t perform that action at this time.