Skip to content

Commit

Permalink
Navbar set
Browse files Browse the repository at this point in the history
  • Loading branch information
paragpurandare committed Feb 6, 2024
2 parents dee90f1 + 829abba commit f5daab0
Show file tree
Hide file tree
Showing 18 changed files with 1,310 additions and 197 deletions.
3 changes: 3 additions & 0 deletions backend/controllers/testResponse.js
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");
}
24 changes: 12 additions & 12 deletions backend/database/database.js
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 };
12 changes: 8 additions & 4 deletions backend/models/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ import mongoose from 'mongoose';
const userSchema = new mongoose.Schema({
name: {
type: String,
required: true
required: false
},
email: {
type: String,
required: true,
required: false,
unique: true
},
password: {
address: {
type: String,
required: true
required: false
},
optionChecked: {
type: Boolean,
required: false
},
loginDate: {
type: Date,
Expand Down
4 changes: 3 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
"license": "ISC",
"dependencies": {
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"mongodb": "^6.3.0",
"mongoose": "^8.0.4"
"mongoose": "^8.0.4",
"socket.io": "^4.7.4"
},
"devDependencies": {
"nodemon": "^3.0.3"
Expand Down
Loading

0 comments on commit f5daab0

Please sign in to comment.