fixed nullpointer

This commit is contained in:
2026-03-25 11:35:17 +01:00
parent 3f0caa8843
commit 2639855e97
3 changed files with 2 additions and 8 deletions

View File

@@ -75,9 +75,3 @@ function formatSlug(slug: string) {
</div>
</div>
</Layout>
>
</a>
))}
</div>
</div>
</Layout>

View File

@@ -3,7 +3,7 @@ import Layout from '../../layouts/Layout.astro';
import { marked } from 'marked';
const { slug } = Astro.params;
const API_URL = (typeof process !== 'undefined' ? process.env.PUBLIC_API_URL : import.meta.env.PUBLIC_API_URL) || 'http://localhost:3000';
const API_URL = import.meta.env.PUBLIC_API_URL || 'http://localhost:3000';
interface PostDetail {
slug: string;

View File

@@ -1,6 +1,6 @@
---
const { path } = Astro.params;
const API_URL = (typeof process !== 'undefined' ? process.env.PUBLIC_API_URL : import.meta.env.PUBLIC_API_URL) || 'http://localhost:3000';
const API_URL = import.meta.env.PUBLIC_API_URL || 'http://localhost:3000';
const response = await fetch(`${API_URL}/uploads/${path}`);