Skip to content

Commit f871b43

Browse files
committed
fix: json fetch url
1 parent 30b8d32 commit f871b43

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/routes/+page.svelte

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
2828
async function fetchNesCarts() {
2929
try {
30-
const response = await fetch('/nesCarts.json');
30+
const basePath = window.location.origin.includes('github') ? '/nes-cart-browser' : '';
31+
const response = await fetch(`${basePath}/nesCarts.json`);
3132
nesCarts = await response.json();
3233
} catch (error) {
3334
console.error('Error fetching nesCarts:', error);
@@ -36,8 +37,8 @@
3637
}
3738
}
3839
39-
// TODO: Open dialog on cart click and show nescartdb entry
40-
// https://nescartdb.com/search/advanced?catalog_op=contains&catalog={catalogId}
40+
// TODO: Open dialog on cart click and show nescartdb entry
41+
// https://nescartdb.com/search/advanced?catalog_op=contains&catalog={catalogId}
4142
</script>
4243

4344
<div class="container py-2">

0 commit comments

Comments
 (0)