Alexandria commit
- Commit to using Alexandria DB - Fixed a bug when a user didn't exist but loading was attempted
This commit is contained in:
parent
3ee7a3a515
commit
1f9970929f
12 changed files with 61 additions and 664 deletions
|
@ -1,15 +1,12 @@
|
|||
//Imports
|
||||
const express = require("express");
|
||||
const session = require("express-session");
|
||||
const cors = require("cors");
|
||||
const bodyParser = require("body-parser");
|
||||
const bearerToken = require('express-bearer-token');
|
||||
const secret = require("uuid-with-v6").v6;
|
||||
const bearerToken = require("express-bearer-token");
|
||||
//Local Imports
|
||||
const { Web, StatusCode, Server } = require("./config.json");
|
||||
//Import Routers
|
||||
const stashRouter = require("./routes/stash");
|
||||
const storage = require("./api/storage");
|
||||
//Define Constants & Setup Database
|
||||
const app = express();
|
||||
const port = Server.Port;
|
||||
|
@ -21,8 +18,7 @@ const corsOptions = {
|
|||
};
|
||||
//Set Up Express session and View engine
|
||||
app.use(cors(corsOptions));
|
||||
app.use(bearerToken())
|
||||
app.use(session({ secret: secret(), saveUninitialized: false, resave: false }));
|
||||
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
|
||||
|
@ -41,6 +37,5 @@ const startServer = () => {
|
|||
console.log("Recieved Shutdown Signal!");
|
||||
process.exit();
|
||||
});
|
||||
setInterval(() => storage.cleanZips(), Server.ZipRemovalInterval);
|
||||
};
|
||||
startServer();
|
||||
|
|
Reference in a new issue