New project structure

New folder structure
Changed to type:module
Moved routes to separate files
This commit is contained in:
2020-07-17 22:07:55 +02:00
parent ad8ed283d2
commit 2abec5017f
28 changed files with 1252 additions and 305 deletions

14
loaders/mongoose.js Normal file
View File

@@ -0,0 +1,14 @@
import mongoose from "mongoose";
export default async ({ pass }) => {
const connection = await mongoose.connect(
"mongodb+srv://menui_db_user:" +
pass +
"@menui-database.9quwf.mongodb.net/<dbname>?retryWrites=true&w=majority",
{ useNewUrlParser: true, useUnifiedTopology: true },
(err) => {
if (err) console.log("Unable to connect :(");
else console.log("Connected To Database");
}
);
};