From 695e2832464f7c78bb9cf012b6e9b4d407308795 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 10 Nov 2023 17:57:59 -0500 Subject: [PATCH] Added some comments --- modules/_server.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/_server.js b/modules/_server.js index ac3c702..4910c08 100644 --- a/modules/_server.js +++ b/modules/_server.js @@ -7,15 +7,19 @@ * Add actual data into the responses */ +// Modules const express = require('express'); const http = require('http'); const fn = require('./functions.js').functions; +const { dbfn } = require('./functions.js'); + +// Grab the current configuration settings from the database to display var config; fn.commands.refreshConfig().then(newConfig => { config = newConfig.config; }); -const { dbfn } = require('./functions.js'); +// Create the server const app = express(); const server = http.createServer(app); app.use(express.urlencoded()); @@ -29,7 +33,7 @@ app.set('view engine', 'html'); // A normal load of the root page 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) }); });