aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-05-06 21:07:24 +0200
committerMateja <mail@matejamaric.com>2021-05-06 21:07:24 +0200
commit376fae2a3367d5813d088a29c5a62938bd55f762 (patch)
tree3812cbf552d90024550cc2e88e0ba2cf4927f191 /models
parente0f29f19df909b7a49ac693d82ba5ff085d079a2 (diff)
downloadnode-playground-376fae2a3367d5813d088a29c5a62938bd55f762.tar.gz
node-playground-376fae2a3367d5813d088a29c5a62938bd55f762.zip
Boilerplate for login system.
Diffstat (limited to 'models')
-rw-r--r--models/user.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/models/user.js b/models/user.js
new file mode 100644
index 0000000..32b0540
--- /dev/null
+++ b/models/user.js
@@ -0,0 +1,12 @@
+const mongoose = require('mongoose');
+
+const userSchema = new mongoose.Schema({
+ firstname: {type: String, required: true},
+ lastname: {type: String, required: true},
+ email: {type: String, required: true},
+ password: {type: String, required: true},
+});
+
+const userModel = new mongoose.Model('user', userSchema);
+
+module.exports = userModel;