From 170ee2d678161e28cc578cbde15425f53d724380 Mon Sep 17 00:00:00 2001 From: jrtechs Date: Sat, 24 Nov 2018 17:20:34 -0500 Subject: [PATCH] Updated a error in CS theory blog post and updated docs on the server.js file. --- .../media/CSTHEORY/PDAConstruction.svg | 2 +- server.js | 27 ++++++++++--------- utils/sql.js | 1 - 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/blogContent/posts/programming/media/CSTHEORY/PDAConstruction.svg b/blogContent/posts/programming/media/CSTHEORY/PDAConstruction.svg index d106f5d..456784f 100644 --- a/blogContent/posts/programming/media/CSTHEORY/PDAConstruction.svg +++ b/blogContent/posts/programming/media/CSTHEORY/PDAConstruction.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/server.js b/server.js index 834a0b8..9bcac45 100644 --- a/server.js +++ b/server.js @@ -5,39 +5,40 @@ * appropriate pages. */ -// Stores the configuration for the server +/** Stores the configuration for the server */ const config = require('./utils/configLoader').getConfig(); -//http server +/** Port for the server to run on */ +const port = config.PORT; + +/** http server */ const http = require('http'); -//used to parse the request URL +/** used to parse the request URL */ const url = require('url'); -//express app +/** express app */ const express = require("express"); -//express app +/** express app */ const app = express(); -//server side logging +/** server side logging */ const sql = require('./utils/sql'); -//Used for gzip compression +/** Used for gzip compression */ const compression = require('compression'); -//used for file io -const utils = require('./utils/utils.js'); -//Updates the site map whenever the server is started +/**Updates the site map whenever the server is started */ const map = require('./utils/generateSiteMap.js'); map.main(); -//session data for login +/**session data for login */ const session = require('express-session'); -//Initializes sessions for login +/**Initializes sessions for login */ app.use(session({ secret: config.SESSION_SECRET, cookie: { maxAge: 6000000 }})); @@ -99,4 +100,4 @@ app.use(function(request, result) app.use(compression()); -http.createServer(app).listen(config.PORT); \ No newline at end of file +http.createServer(app).listen(port); \ No newline at end of file diff --git a/utils/sql.js b/utils/sql.js index f5d61c9..bce6114 100644 --- a/utils/sql.js +++ b/utils/sql.js @@ -27,7 +27,6 @@ const con = mysql.createConnection({ database: config.SQL_DATABASE }); - con.connect(function(err) { if (err) console.log(err);