From 99c5871009a16a9f9548ad16d31542cc27845517 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Wed, 25 Mar 2026 11:23:24 +0100 Subject: [PATCH] fixed backend ip --- frontend/src/pages/index.astro | 8 +++++++- frontend/src/pages/posts/[slug].astro | 2 +- frontend/src/pages/uploads/[...path].astro | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/index.astro b/frontend/src/pages/index.astro index 95e1e8f..87ea33e 100644 --- a/frontend/src/pages/index.astro +++ b/frontend/src/pages/index.astro @@ -32,7 +32,7 @@ function formatSlug(slug: string) {
-

+

Welcome to my blog

@@ -75,3 +75,9 @@ function formatSlug(slug: string) {

+> + + ))} + + + diff --git a/frontend/src/pages/posts/[slug].astro b/frontend/src/pages/posts/[slug].astro index 585c67c..03ded96 100644 --- a/frontend/src/pages/posts/[slug].astro +++ b/frontend/src/pages/posts/[slug].astro @@ -3,7 +3,7 @@ import Layout from '../../layouts/Layout.astro'; import { marked } from 'marked'; const { slug } = Astro.params; -const API_URL = import.meta.env.PUBLIC_API_URL || 'http://localhost:3000'; +const API_URL = (typeof process !== 'undefined' ? process.env.PUBLIC_API_URL : import.meta.env.PUBLIC_API_URL) || 'http://localhost:3000'; interface PostDetail { slug: string; diff --git a/frontend/src/pages/uploads/[...path].astro b/frontend/src/pages/uploads/[...path].astro index fba467a..1711c19 100644 --- a/frontend/src/pages/uploads/[...path].astro +++ b/frontend/src/pages/uploads/[...path].astro @@ -1,6 +1,6 @@ --- const { path } = Astro.params; -const API_URL = import.meta.env.PUBLIC_API_URL || 'http://localhost:3000'; +const API_URL = (typeof process !== 'undefined' ? process.env.PUBLIC_API_URL : import.meta.env.PUBLIC_API_URL) || 'http://localhost:3000'; const response = await fetch(`${API_URL}/uploads/${path}`);