caddy-ui/app/api/caddy/config/route.ts
2023-11-15 00:52:24 -05:00

15 lines
No EOL
402 B
TypeScript

// Import the NextJS API route handler
import { getConfig } from '@/lib/utils';
import { NextResponse } from 'next/server';
// Define the route handler function
export async function GET() {
let caddyConfig = await getConfig();
return new NextResponse(JSON.stringify(caddyConfig), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});
}