initial COM2 system snapshot
This commit is contained in:
21
web/nextjs/app/api/homepage/route.ts
Normal file
21
web/nextjs/app/api/homepage/route.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import fs from "fs";
|
||||
|
||||
export async function GET() {
|
||||
const path = "/opt/hx-ki/workspaces/homepage/homepage.json";
|
||||
|
||||
try {
|
||||
const raw = fs.readFileSync(path, "utf-8");
|
||||
const data = JSON.parse(raw);
|
||||
return NextResponse.json(data);
|
||||
} catch (err) {
|
||||
console.error("Error reading homepage.json:", err);
|
||||
return NextResponse.json(
|
||||
{
|
||||
error: "Homepage content not available",
|
||||
details: "Check /opt/hx-ki/workspaces/homepage/homepage.json on Falkenstein."
|
||||
},
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user