Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
web ui should use stage kinto, fixes #458 (#460)
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Bengtsson authored May 11, 2018
1 parent 3099235 commit d9bafe9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ui/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@ import {
import "searchkit/release/theme.css";

import contribute_json from "./contribute.json";
const KINTO_COLLECTION_URL =
process.env.REACT_APP_KINTO_COLLECTION_URL ||

let defaultCollectionURL =
"https://buildhub.prod.mozaws.net/v1/buckets/build-hub/collections/releases/";
// There is an exception to this rule, the default (when
// REACT_APP_KINTO_COLLECTION_URL isn't set) depends on how this UI is rendered.
if (
window.location.pathname &&
window.location.pathname.search(/\/stage\//) > -1
) {
defaultCollectionURL =
"https://buildhub.stage.mozaws.net/v1/buckets/build-hub/collections/releases/";
}
const KINTO_COLLECTION_URL =
process.env.REACT_APP_KINTO_COLLECTION_URL || defaultCollectionURL;

const searchkit = new SearchkitManager(KINTO_COLLECTION_URL, {
searchUrlPath: "search"
Expand Down

0 comments on commit d9bafe9

Please sign in to comment.