diff options
author | Mark Powers <mark@marks.kitchen> | 2024-07-14 15:17:48 -0500 |
---|---|---|
committer | Mark Powers <mark@marks.kitchen> | 2024-07-14 15:17:48 -0500 |
commit | cfe7d7d4c4f9bac7262f495b770da8ad64c5e6c2 (patch) | |
tree | 18e4a9a8d7e98baec1d6b612a4cb151c69270edb /src/index.js | |
parent | ba26da4ac06807cde20ca2ee52064f66829f0348 (diff) |
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 11 |
1 files changed, 5 insertions, 6 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); |