Change chart endpoints to use get_json route

This commit is contained in:
Sam 2024-08-13 18:53:59 +01:00
parent ed011152b2
commit 1ef277edc5
4 changed files with 7 additions and 4 deletions

View File

@ -3,7 +3,7 @@ const myChart = echarts.init(document.getElementById("chart"));
async function fetchDataForChart() {
try {
const apiEndpoint = "https://api.bitlab21.com/price";
const apiEndpoint = "https://api.bitlab21.com/get_json/final__price.json";
const response = await fetch(apiEndpoint);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);

View File

@ -3,7 +3,8 @@ const myChart = echarts.init(document.getElementById("chart"));
async function fetchDataForChart() {
try {
const apiEndpoint = "https://api.bitlab21.com/feerates";
const apiEndpoint =
"https://api.bitlab21.com/get_json/final__feerate_percentiles.json";
const response = await fetch(apiEndpoint);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);

View File

@ -3,7 +3,8 @@ const myChart = echarts.init(document.getElementById("chart"));
async function fetchDataForChart() {
try {
const apiEndpoint = "https://api.bitlab21.com/hashrate";
const apiEndpoint =
"https://api.bitlab21.com/get_json/final__hashrate.json";
const response = await fetch(apiEndpoint);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);

View File

@ -3,7 +3,8 @@ const myChart = echarts.init(document.getElementById("chart"));
async function fetchDataForChart() {
try {
const apiEndpoint = "https://api.bitlab21.com/miner_rewards";
const apiEndpoint =
"https://api.bitlab21.com/get_json/final__miner_rewards.json";
const response = await fetch(apiEndpoint);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);