Skip to content
This repository was archived by the owner on Jul 8, 2020. It is now read-only.

Support LIGHTHOUSE_BUILDER_HOST env variable in frontend server #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion frontend/lighthouse-ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const Github = require('@octokit/rest');
const URL = require('url').URL;
const URLSearchParams = require('url').URLSearchParams;

const LIGHTHOUSE_BUILDER_HOST = process.env.LIGHTHOUSE_BUILDER_HOST || 'https://builder-dot-lighthouse-ci.appspot.com';

class LighthouseCI {
/**
* @param {!string} token Github OAuth token that has repo:status access.
Expand All @@ -44,7 +46,7 @@ class LighthouseCI {

// POST https://builder-dot-lighthouse-ci.appspot.com/ci
// '{"output": "json", "url": <testUrl>}"'
return fetch('https://builder-dot-lighthouse-ci.appspot.com/ci', {
return fetch(`${LIGHTHOUSE_BUILDER_HOST}/ci`, {
method: 'POST',
body: JSON.stringify(body),
headers
Expand Down