Added signup route 👤

This commit is contained in:
Manik Maity
2024-11-07 21:08:08 +05:30
parent a3c5140bb4
commit 8741f40304
12 changed files with 1096 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
import mongoose, { Schema } from "mongoose";
const userSchema = new Schema({
username : {
type : String,
required : true,
trim : true
},
email : {
type : String,
required : true,
trim : true,
unique : true
},
password : {
type : String,
required : true
},
bookmarks : {
type : [Schema.Types.ObjectId],
ref : "Poll",
default : []
}
}, {timestamps : true});
const UserModel = mongoose.model("User", userSchema);
export default UserModel;