diff --git a/config/config.js b/config/config.js index 03613ce..a1277ee 100644 --- a/config/config.js +++ b/config/config.js @@ -9,5 +9,6 @@ export default { GITHUB_CLIENT_SECRET: "a2b8462d6cefb17339f4b730578db280b65e84ad", GITHUB_REDIRECT_URI: "http://localhost/auth/github/callback", gmail_user:"auth.test.reg.email@gmail.com", - gmail_password:"sbuLBh9rAV8XD2" + gmail_password:"sbuLBh9rAV8XD2", + mongodb_url:"mongodb://localhost/" } \ No newline at end of file diff --git a/server/helpers/db_ops.ts b/server/helpers/db_ops.ts index c8cf4eb..1286e30 100644 --- a/server/helpers/db_ops.ts +++ b/server/helpers/db_ops.ts @@ -1,6 +1,7 @@ import {MongoClient} from 'mongodb' import crypto from "crypto" -const url = 'mongodb://localhost/'; +import config from '../../config/config' +const url = config.mongodb_url; const options = { useNewUrlParser: true, useUnifiedTopology: true diff --git a/server/index.ts b/server/index.ts index e970395..d3a37a8 100644 --- a/server/index.ts +++ b/server/index.ts @@ -75,7 +75,7 @@ next_app.prepare().then(() => { sameSite: 'lax' }, store: new MongoStore({ - url: 'mongodb://localhost/Scenery', + url: config.mongodb_url+'Scenery', ttl: 14 * 24 * 60 * 60 }) // = 14 days. Default }))