diff --git a/src/index.js b/src/index.js index dddfe03..7e95d52 100644 --- a/src/index.js +++ b/src/index.js @@ -3,19 +3,17 @@ const express = require("express"); const bodyParser = require("body-parser"); const bearerToken = require("express-bearer-token"); // Local Imports -const { Web, StatusCode, Server } = require("./config.json"); +const { Server } = require("./config.json"); // Import Routers -const stashRouter = require("./routes/stash"); +const stashRouter = require("./routes/stash-route"); // Define Constants & Setup Database const app = express(); const port = Server.Port; const timeout = 10 * 60 * 1000; -const debuggingMode = Server.Debug; -const viewOptions = { beautify: false }; // Set Up Express session and View engine app.use(bearerToken()); -app.use(bodyParser.json({ limit: Server.BodyLimit })); // parse application/json -app.use(bodyParser.urlencoded({ limit: Server.BodyLimit, extended: false })); // parse application/x-www-form-urlencoded +app.use(bodyParser.json({ limit: Server.BodyLimit })); +app.use(bodyParser.urlencoded({ limit: Server.BodyLimit, extended: false })); app.use(["/nubian/api/stash", "/api/stash", "/stash"], stashRouter); const startServer = () => { var server = app.listen(port, () => { @@ -24,9 +22,5 @@ const startServer = () => { }); server.timeout = timeout; server.on("connection", (socket) => socket.setTimeout(timeout)); - process.on("SIGINT", () => { - console.log("Recieved Shutdown Signal!"); - process.exit(); - }); }; startServer(); diff --git a/src/routes/stash.js b/src/routes/stash-route.js similarity index 100% rename from src/routes/stash.js rename to src/routes/stash-route.js