Added some comments

This commit is contained in:
Skylar Grant 2023-11-10 17:57:59 -05:00
parent 43ab7dd367
commit 695e283246
1 changed files with 6 additions and 2 deletions

View File

@ -7,15 +7,19 @@
* Add actual data into the responses * Add actual data into the responses
*/ */
// Modules
const express = require('express'); const express = require('express');
const http = require('http'); const http = require('http');
const fn = require('./functions.js').functions; const fn = require('./functions.js').functions;
const { dbfn } = require('./functions.js');
// Grab the current configuration settings from the database to display
var config; var config;
fn.commands.refreshConfig().then(newConfig => { fn.commands.refreshConfig().then(newConfig => {
config = newConfig.config; config = newConfig.config;
}); });
const { dbfn } = require('./functions.js');
// Create the server
const app = express(); const app = express();
const server = http.createServer(app); const server = http.createServer(app);
app.use(express.urlencoded()); app.use(express.urlencoded());
@ -29,7 +33,7 @@ app.set('view engine', 'html');
// A normal load of the root page // A normal load of the root page
app.get('/', (req, res) => { app.get('/', (req, res) => {
// if (process.env.DEBUG) console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${JSON.stringify(config)}`); // Render the page, passing the config along for the front end to use
res.render('index', { config: JSON.stringify(config) }); res.render('index', { config: JSON.stringify(config) });
}); });