Update various configuration files, components, and assets; enhance notification system and API endpoints; improve documentation and styles across the application.
This commit is contained in:
22
server/api/devtool/config/env.js
Normal file
22
server/api/devtool/config/env.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
// Get .env file, parse and return
|
||||
const envFile = path.join(process.cwd(), ".env");
|
||||
|
||||
if (!fs.existsSync(envFile)) {
|
||||
return {
|
||||
statusCode: 404,
|
||||
message: "File not found",
|
||||
};
|
||||
}
|
||||
|
||||
const env = fs.readFileSync(envFile, "utf-8");
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
message: "Success",
|
||||
data: env,
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user