-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
1,310 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function testResponse(req, res) { | ||
res.send("hello from express server"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import mongoose from "mongoose"; | ||
import dotenv from 'dotenv' | ||
import dotenv from "dotenv"; | ||
|
||
dotenv.config(); | ||
|
||
|
||
const connectDB = async () => { | ||
mongoose.set("strictQuery", false); | ||
const conn = await mongoose | ||
.connect(process.env.MONGODB_URI, { | ||
dbName: "s2sdb", | ||
}) | ||
.then(() => console.log("database connected")) | ||
.catch((e) => { | ||
console.log(e); | ||
}); | ||
}; | ||
|
||
mongoose.set('strictQuery', false); | ||
const conn = await mongoose.connect(process.env.MONGODB_URI, { | ||
dbName: "s2sdb" | ||
}).then(() => console.log("database connected")) | ||
.catch((e) => { console.log(e) }) | ||
} | ||
|
||
|
||
|
||
export {connectDB} | ||
export { connectDB }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.