New project structure
New folder structure Changed to type:module Moved routes to separate files
This commit is contained in:
14
loaders/mongoose.js
Normal file
14
loaders/mongoose.js
Normal 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");
|
||||
}
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user