aboutsummaryrefslogtreecommitdiffstats
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/User.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/models/User.js b/server/models/User.js
new file mode 100644
index 0000000..6773c64
--- /dev/null
+++ b/server/models/User.js
@@ -0,0 +1,7 @@
+const mongoose = require('mongoose');
+const UserSchema = new mongoose.Schema({
+ username: { type: String, reauired: true, unique: true },
+ password: { type: String, required: true },
+ role: { type: String, default: 'admin' },
+});
+module.exports = mongoose.model('User', UserSchema);