From 0e74534cde4539ae0c007f241f20af5ab2ee9797 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 14:00:42 +0200 Subject: [PATCH 1/3] Removed unnecessary mongo connection string. --- api/lottery.js | 5 ----- api/retrieve.js | 4 ---- api/subscriptions.js | 5 ----- api/update.js | 4 ---- 4 files changed, 18 deletions(-) diff --git a/api/lottery.js b/api/lottery.js index 17d8e29..2a0145f 100644 --- a/api/lottery.js +++ b/api/lottery.js @@ -1,10 +1,5 @@ const path = require('path'); -const mongoose = require('mongoose'); -mongoose.connect('mongodb://localhost:27017/vinlottis', { - useNewUrlParser: true -}) - const Highscore = require(path.join(__dirname + '/../schemas/Highscore')); const Wine = require(path.join(__dirname + '/../schemas/Wine')); diff --git a/api/retrieve.js b/api/retrieve.js index 92bb2a6..d377c60 100644 --- a/api/retrieve.js +++ b/api/retrieve.js @@ -1,8 +1,4 @@ const path = require("path"); -const mongoose = require("mongoose"); -mongoose.connect("mongodb://localhost:27017/vinlottis", { - useNewUrlParser: true -}); const Purchase = require(path.join(__dirname + "/../schemas/Purchase")); const Wine = require(path.join(__dirname + "/../schemas/Wine")); diff --git a/api/subscriptions.js b/api/subscriptions.js index 574280c..1d61a08 100644 --- a/api/subscriptions.js +++ b/api/subscriptions.js @@ -2,13 +2,8 @@ const express = require("express"); const path = require("path"); const router = express.Router(); const webpush = require("web-push"); //requiring the web-push module -const mongoose = require("mongoose"); const schedule = require("node-schedule"); -mongoose.connect("mongodb://localhost:27017/vinlottis", { - useNewUrlParser: true -}); - const mustBeAuthenticated = require(path.join( __dirname + "/../middleware/mustBeAuthenticated" )); diff --git a/api/update.js b/api/update.js index 59642dc..c3fa4d1 100644 --- a/api/update.js +++ b/api/update.js @@ -1,9 +1,5 @@ const express = require("express"); const path = require("path"); -const mongoose = require("mongoose"); -mongoose.connect("mongodb://localhost:27017/vinlottis", { - useNewUrlParser: true -}); const sub = require(path.join(__dirname + "/../api/subscriptions")); From f2989d2534c13fa87f23391763907453de0dd5d6 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sun, 11 Oct 2020 18:14:43 +0200 Subject: [PATCH 2/3] Use api.js funcs over manual fetch. --- src/components/TodaysPage.vue | 4 ++-- src/components/WinnerPage.vue | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/TodaysPage.vue b/src/components/TodaysPage.vue index 0dfdf12..de81fc1 100644 --- a/src/components/TodaysPage.vue +++ b/src/components/TodaysPage.vue @@ -11,6 +11,7 @@ diff --git a/src/components/WinnerPage.vue b/src/components/WinnerPage.vue index 434f9d7..c60472c 100644 --- a/src/components/WinnerPage.vue +++ b/src/components/WinnerPage.vue @@ -29,7 +29,7 @@