commit 409b76d0afc650bb6647ba7fc16e8b967d2cc4bd
parent d7fd03f7a15dbfc2f35abd227cffe80747d199bb
Author: Henry Unite <unitehenry@gmail.com>
Date: Mon, 11 May 2026 04:51:54 +0000
fix: feeds from base path
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/app/src/App.tsx b/app/src/App.tsx
@@ -150,16 +150,18 @@ export function App() {
const { theme, setTheme } = useTheme()
const toggleTheme = () => setTheme(theme === "dark" ? "light" : "dark")
+ const basePath = import.meta.env.VITE_BASE_PATH || ""
+
useEffect(() => {
async function loadFeeds() {
try {
- const csvResponse = await fetch("/feeds/feeds.csv")
+ const csvResponse = await fetch(`${basePath}/feeds/feeds.csv`)
const csvText = await csvResponse.text()
const lines = csvText.trim().split("\n")
const feedPromises = lines.map(async (line) => {
try {
const [displayName, , file] = line.split(",")
- const jsonResponse = await fetch(`/feeds/${file}.json`)
+ const jsonResponse = await fetch(`${basePath}/feeds/${file}.json`)
if (!jsonResponse.ok)
throw new Error(`Fetch failed: ${jsonResponse.status}`)
const data = await jsonResponse.json()
@@ -254,7 +256,7 @@ export function App() {
}
}
loadFeeds()
- }, [])
+ }, [basePath])
if (loading) {
return (