Revert "Add dashboard UI and secure API endpoints"

This commit is contained in:
2026-01-27 15:30:09 +01:00
committed by GitHub
parent f38b8a2199
commit cbf9c112a4
12 changed files with 181 additions and 1193 deletions
+2 -18
View File
@@ -1,27 +1,11 @@
const fs = require('node:fs');
const path = require('node:path');
const {MongoClient, ServerApiVersion} = require('mongodb');
const loadConfig = () => {
const configPath = path.join(__dirname, 'config.json');
if (fs.existsSync(configPath)) {
return require(configPath);
}
return {};
};
const config = loadConfig();
const MONGODB_URI = process.env.MONGODB_URI || config.mongodb;
const {mongodb} = require("./config.json");
let dbClient;
async function connectToDatabase() {
if (!dbClient) {
if (!MONGODB_URI) {
throw new Error('Missing MongoDB connection string.');
}
dbClient = new MongoClient(MONGODB_URI, {
dbClient = new MongoClient(mongodb, {
serverApi: {
version: ServerApiVersion.v1,
strict: true,