diff --git a/.env.example b/.env.example index 518df8a..255daf9 100755 --- a/.env.example +++ b/.env.example @@ -1,4 +1,7 @@ -mongoURI='mongodb://localhost:27017/' -database='nameOfDatabase' +MONGO_URI='mongodb://localhost:27017/' +DATABASE='nameOfDatabase' PORT=8000 -secret='123456789' \ No newline at end of file +SECRET='123456789' +GEOLOCATION_API='api_key' +EMAIL_USER=mail@example.com +EMAIL_PASS='password' diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index c8a7ed4..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "editor.fontFamily": "Monocraft", - "editor.fontLigatures": true -} \ No newline at end of file diff --git a/app.js b/app.js index 466d093..d2fce68 100644 --- a/app.js +++ b/app.js @@ -9,9 +9,9 @@ require('dotenv').config(); const app = express(); const port = process.env.PORT || 3000; -const mongoURI = process.env.mongoURI; -const database = process.env.database; // Database name -const secret = process.env.secret || "123-secret-xyz"; +const mongoURI = process.env.MONGO_URI; +const database = process.env.DATABASE; // Database name +const secret = process.env.SECRET || "123-secret-xyz"; /*** Sessions ***/ app.use(session({ @@ -36,7 +36,7 @@ let users; let assets; let plans; async function initDatabase() { - const db = await connectMongo(mongoURI, database); + const db = connectMongo(mongoURI, database); // For any collection, init here users = await getCollection(db, "users");