removed idea folder
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import {NextResponse} from "next/server";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
export async function GET() {
|
||||
const configPath = process.env.CONFIG_PATH || "./config.json";
|
||||
const absolutePath = path.resolve(configPath);
|
||||
|
||||
if (!fs.existsSync(absolutePath)) {
|
||||
return NextResponse.json({error: "Config file not found"}, {status: 404});
|
||||
}
|
||||
|
||||
const fileContent = fs.readFileSync(absolutePath, "utf-8");
|
||||
const config = JSON.parse(fileContent);
|
||||
|
||||
return NextResponse.json(config);
|
||||
}
|
||||
Reference in New Issue
Block a user