aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/index.js11
-rw-r--r--src/quadrowple/server.js2
-rw-r--r--src/quiz-bunny/server.js2
-rw-r--r--src/server.js2
-rw-r--r--src/trivia/server.js2
5 files changed, 9 insertions, 10 deletions
diff --git a/src/index.js b/src/index.js
index c731166..660cdc7 100644
--- a/src/index.js
+++ b/src/index.js
@@ -4,9 +4,8 @@ const path = require('path');
const jwt = require('jsonwebtoken');
// Load the config and configurable parameteres
-const config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config.json')));
-const dbCreds = config.database
-const secret = config.jwt_secret;
+const { env } = require('node:process');
+const secret = env.JWT_SECRET
// An object to help sign and verify jwt cookies
const jwtFunctions = {
@@ -19,7 +18,7 @@ const jwtFunctions = {
}
// Create the database object
-const database = new Sequelize(dbCreds.database, undefined, undefined, {
+const database = new Sequelize(env.DATABASE, undefined, undefined, {
logging(str) {
console.debug(`DB:${str}`);
},
@@ -27,7 +26,7 @@ const database = new Sequelize(dbCreds.database, undefined, undefined, {
charset: 'utf8mb4',
multipleStatements: true,
},
- storage: './database.sqlite',
+ storage: '/data/database.sqlite',
dialect: 'sqlite',
pool: {
max: 5,
@@ -87,4 +86,4 @@ server.load("./paperflight/server", models, jwtFunctions, database)
server.load("./trivia/server", models, jwtFunctions, database)
// Start the server
-server.listen(config.port);
+server.listen(8080);
diff --git a/src/quadrowple/server.js b/src/quadrowple/server.js
index 3474c6b..fc54d4b 100644
--- a/src/quadrowple/server.js
+++ b/src/quadrowple/server.js
@@ -1,4 +1,4 @@
-const uuidv4 = require('uuid/v4');
+const uuidv4 = require('uuid')["v4"];
function setUpRoutes(server, models, jwtFunctions, database) {
diff --git a/src/quiz-bunny/server.js b/src/quiz-bunny/server.js
index 0725fdc..347223e 100644
--- a/src/quiz-bunny/server.js
+++ b/src/quiz-bunny/server.js
@@ -1,4 +1,4 @@
-const uuidv4 = require('uuid/v4');
+const uuidv4 = require('uuid')["v4"];
const words = require('./words').words;
const prompts = require('./prompts').prompts;
diff --git a/src/server.js b/src/server.js
index c159666..91c6d05 100644
--- a/src/server.js
+++ b/src/server.js
@@ -1,7 +1,7 @@
const express = require('express');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
-const uuidv4 = require('uuid/v4');
+const uuidv4 = require('uuid')["v4"];
const Op = require('sequelize').Op;
const server = express();
diff --git a/src/trivia/server.js b/src/trivia/server.js
index 910f836..3c66050 100644
--- a/src/trivia/server.js
+++ b/src/trivia/server.js
@@ -1,4 +1,4 @@
-const uuidv4 = require('uuid/v4');
+const uuidv4 = require('uuid')["v4"];
const words = require('./words').words;
const prompts = require('./prompts').prompts;