refactor(email): improve code formatting and error handling in email route
This commit is contained in:
@@ -2,7 +2,7 @@ import {NextResponse} from "next/server";
|
|||||||
|
|
||||||
export const runtime = "nodejs"; // Force Node runtime
|
export const runtime = "nodejs"; // Force Node runtime
|
||||||
|
|
||||||
const GHOST_API_URL = "http://172.21.0.3:2368";
|
const GHOST_API_URL = "http://192.168.179.31:2368";
|
||||||
const GHOST_API_KEY = process.env.GHOST_API_KEY;
|
const GHOST_API_KEY = process.env.GHOST_API_KEY;
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
@@ -12,7 +12,7 @@ export async function GET() {
|
|||||||
);
|
);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
console.error(`Failed to fetch posts: ${response.statusText}`);
|
console.error(`Failed to fetch posts: ${response.statusText}`);
|
||||||
return NextResponse.json({});
|
return NextResponse.json([]);
|
||||||
}
|
}
|
||||||
const posts = await response.json();
|
const posts = await response.json();
|
||||||
return NextResponse.json(posts);
|
return NextResponse.json(posts);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ interface ProjectsData {
|
|||||||
|
|
||||||
export const runtime = "nodejs"; // Force Node runtime
|
export const runtime = "nodejs"; // Force Node runtime
|
||||||
|
|
||||||
const GHOST_API_URL = "http://172.21.0.3:2368";
|
const GHOST_API_URL = "http://192.168.179.31:2368";
|
||||||
const GHOST_API_KEY = process.env.GHOST_API_KEY;
|
const GHOST_API_KEY = process.env.GHOST_API_KEY;
|
||||||
|
|
||||||
// Funktion, um die XML für die Sitemap zu generieren
|
// Funktion, um die XML für die Sitemap zu generieren
|
||||||
|
|||||||
Reference in New Issue
Block a user