aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
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;