refactor(email): improve code formatting and error handling in email route

This commit is contained in:
2025-02-13 17:46:39 +01:00
parent e610b9b462
commit 864580c0ab
2 changed files with 3 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ import {NextResponse} from "next/server";
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;
export async function GET() {
@@ -12,7 +12,7 @@ export async function GET() {
);
if (!response.ok) {
console.error(`Failed to fetch posts: ${response.statusText}`);
return NextResponse.json({});
return NextResponse.json([]);
}
const posts = await response.json();
return NextResponse.json(posts);