initial commit
This commit is contained in:
12
src/app/api/nodes/route.js
Normal file
12
src/app/api/nodes/route.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { getNodes } from '@/lib/proxmox';
|
||||
|
||||
/** @param {import('next').Request} _req */
|
||||
export async function GET(_req) {
|
||||
try {
|
||||
const data = await getNodes();
|
||||
return NextResponse.json({ data, timestamp: Date.now() });
|
||||
} catch (error) {
|
||||
return NextResponse.json({ error: error.message, data: null }, { status: 502 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user