aboutsummaryrefslogtreecommitdiffstats
path: root/server/models
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-07-18 14:56:39 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-07-18 14:56:39 +0530
commit2f613682b733f8f03634df08270469830cad1800 (patch)
treebab1e0c7b19aa9538bbcb099d7e5b36c1f264528 /server/models
parent05faaf231620ce8d4ee67585bd86f1e97fd32eeb (diff)
downloadadmin-panel-2f613682b733f8f03634df08270469830cad1800.tar.gz
admin-panel-2f613682b733f8f03634df08270469830cad1800.tar.bz2
admin-panel-2f613682b733f8f03634df08270469830cad1800.zip
added the config and setup the basic auth
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);