Updated package.json
This commit is contained in:
parent
a29ac8dda8
commit
496442fb77
2 changed files with 15 additions and 24 deletions
|
@ -1,38 +1,29 @@
|
|||
//Imports
|
||||
// Imports
|
||||
const express = require("express");
|
||||
const cors = require("cors");
|
||||
const bodyParser = require("body-parser");
|
||||
const bearerToken = require("express-bearer-token");
|
||||
//Local Imports
|
||||
// Local Imports
|
||||
const { Web, StatusCode, Server } = require("./config.json");
|
||||
//Import Routers
|
||||
// Import Routers
|
||||
const stashRouter = require("./routes/stash");
|
||||
//Define Constants & Setup Database
|
||||
// Define Constants & Setup Database
|
||||
const app = express();
|
||||
const port = Server.Port;
|
||||
const timeout = 10 * 60 * 1000;
|
||||
const debuggingMode = Server.Debug;
|
||||
const viewOptions = { beautify: false };
|
||||
const corsOptions = {
|
||||
origin: "*",
|
||||
optionsSuccessStatus: 200,
|
||||
};
|
||||
//Set Up Express session and View engine
|
||||
app.use(cors(corsOptions));
|
||||
// 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
|
||||
//Test if there is a
|
||||
app.use(["/api/nubian/stash", "/api/stash", "/stash"], stashRouter);
|
||||
app.use(["/nubian/api/stash", "/api/stash", "/stash"], stashRouter);
|
||||
const startServer = () => {
|
||||
server = app.listen(port, () => {
|
||||
var server = app.listen(port, () => {
|
||||
console.log("Node version:" + process.versions.node);
|
||||
console.log(`Duneserver listening on port ${port}!`);
|
||||
});
|
||||
server.timeout = 10 * 60 * 1000;
|
||||
server.on("connection", (socket) => {
|
||||
// 10 minutes timeout
|
||||
socket.setTimeout(10 * 60 * 1000);
|
||||
});
|
||||
server.timeout = timeout;
|
||||
server.on("connection", (socket) => socket.setTimeout(timeout));
|
||||
process.on("SIGINT", () => {
|
||||
console.log("Recieved Shutdown Signal!");
|
||||
process.exit();
|
Reference in a new issue