fix fetch url for stats
This commit is contained in:
@@ -122,7 +122,7 @@ function LandingPage() {
|
|||||||
|
|
||||||
/** Parse `games/stats.csv` if present and display server capacity. */
|
/** Parse `games/stats.csv` if present and display server capacity. */
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
fetch('games/stats.csv')
|
fetch(`${window.location.origin}/data/stats`)
|
||||||
.then(response => {if (response.ok) {
|
.then(response => {if (response.ok) {
|
||||||
return response.text() } else {throw ""}})
|
return response.text() } else {throw ""}})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
@@ -138,8 +138,7 @@ function LandingPage() {
|
|||||||
setUsageMem(100 * Number(values[1]));
|
setUsageMem(100 * Number(values[1]));
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.info('games/stats.csv does not exist')
|
console.info('stats.csv does not exist.')
|
||||||
console.info(err)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user