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
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user