Skip to content

Commit

Permalink
Get pre-rendering working again
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Nov 8, 2019
1 parent 2b0da00 commit 15832ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import coinBlackList from './coin-blacklist';
import formatDollars from './format-dollars';
import formatHashrate from './format-hashrate';

const IS_DEV = document.location.hostname === 'localhost';
const BITOIN_CONFIRMATIONS = 6;

const API = IS_DEV ? '/api/data' : 'https://howmanyconfs.com/api/data'

document.querySelector('.version').textContent = `v${version}`;

const table = document.querySelector('table.results');
Expand Down Expand Up @@ -79,7 +82,7 @@ const render = (coins, sortBy) => {
document.dispatchEvent(new Event('prerender-trigger'));
};

fetch('/api/data')
fetch(API)
.then(response => response.json())
.then(coins => {
const bitcoin = coins.find(coin => coin.symbol === 'BTC');
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
"xo": {
"env": "browser"
},
"prerender": {
"rendererConfig": {
"renderAfterDocumentEvent": "prerender-trigger"
}
},
"dependencies": {
"babel-polyfill": "^6.26.0",
"coinlist": "^3.1.2",
Expand Down

0 comments on commit 15832ec

Please sign in to comment.