implemented logging

This commit is contained in:
2026-03-25 11:43:53 +01:00
parent df71ceea7a
commit 2723fb0ca3
4 changed files with 28 additions and 2 deletions

View File

@@ -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",

View File

@@ -18,5 +18,8 @@
"astro": "^6.0.8",
"marked": "^17.0.5",
"tailwindcss": "^4.2.2"
},
"devDependencies": {
"@types/node": "^25.5.0"
}
}

View File

@@ -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) {

View File

@@ -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) {