Skip to content

Commit

Permalink
Login Register Completed
Browse files Browse the repository at this point in the history
  • Loading branch information
dssagar93 committed Nov 12, 2020
0 parents commit 2a7acfd
Show file tree
Hide file tree
Showing 10 changed files with 1,889 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env_sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DB_CONNECTION=YOUR_MONGO_DB_ATLAS_CONNECTION_STRING
TOKEN_SECRET=YOUR_JWT_TOKEN_SECRET
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
node_modules
28 changes: 28 additions & 0 deletions model/User.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const mongoose = require('mongoose');

const userSchema = new mongoose.Schema({
name: {
type: String,
required: true,
min: 6,
max: 255
},
email: {
type: String,
required: true,
max: 255,
min: 5
},
password: {
type: String,
required: true,
max: 1024,
min: 6
},
date: {
type: Date,
default: Date.now
}
});

module.exports = mongoose.model('User', userSchema);
Loading

0 comments on commit 2a7acfd

Please sign in to comment.