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"));