Clean up code

This commit is contained in:
2025-10-09 18:46:14 +02:00
parent a45e379dd1
commit fd186a1c3b

View File

@@ -1,12 +1,11 @@
import { configPath, configTemplate } from '@/const/api';
import fs from 'fs/promises';
import { NextRequest, NextResponse } from 'next/server';
import { NextResponse } from 'next/server';
export async function GET(request: NextRequest) {
export async function GET() {
try {
const fileBuffer = await fs.readFile(configPath, 'utf8');
const config = JSON.parse(fileBuffer);
console.log(config);
return NextResponse.json(config, { status: 200 });
} catch {
await fs.writeFile(configPath, JSON.stringify(configTemplate, null, 2));