diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 2943da8..105aced 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -15,6 +15,9 @@ "marked": "^17.0.5", "tailwindcss": "^4.2.2" }, + "devDependencies": { + "@types/node": "^25.5.0" + }, "engines": { "node": ">=22.12.0" } @@ -1986,6 +1989,16 @@ "@types/unist": "*" } }, + "node_modules/@types/node": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz", + "integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.18.0" + } + }, "node_modules/@types/unist": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", @@ -5160,6 +5173,13 @@ "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==", "license": "MIT" }, + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "devOptional": true, + "license": "MIT" + }, "node_modules/unified": { "version": "11.0.5", "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", diff --git a/frontend/package.json b/frontend/package.json index f09e13d..1531dd8 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -18,5 +18,8 @@ "astro": "^6.0.8", "marked": "^17.0.5", "tailwindcss": "^4.2.2" + }, + "devDependencies": { + "@types/node": "^25.5.0" } } diff --git a/frontend/src/pages/index.astro b/frontend/src/pages/index.astro index ed0010c..b6809f0 100644 --- a/frontend/src/pages/index.astro +++ b/frontend/src/pages/index.astro @@ -2,6 +2,7 @@ import Layout from '../layouts/Layout.astro'; const API_URL = (typeof process !== 'undefined' ? process.env.PUBLIC_API_URL : import.meta.env.PUBLIC_API_URL) || 'http://localhost:3000'; +console.log('Connecting to backend at:', API_URL); interface Post { slug: string; @@ -18,7 +19,8 @@ try { error = 'Failed to fetch posts'; } } catch (e) { - error = 'Could not connect to backend'; + error = `Could not connect to backend at ${API_URL}: ${e instanceof Error ? e.message : String(e)}`; + console.error(error); } function formatSlug(slug: string) { diff --git a/frontend/src/pages/posts/[slug].astro b/frontend/src/pages/posts/[slug].astro index 03ded96..bb1c028 100644 --- a/frontend/src/pages/posts/[slug].astro +++ b/frontend/src/pages/posts/[slug].astro @@ -25,7 +25,8 @@ try { error = 'Post not found'; } } catch (e) { - error = 'Could not connect to backend'; + error = `Could not connect to backend at ${API_URL}: ${e instanceof Error ? e.message : String(e)}`; + console.error(error); } function formatSlug(slug: string) {