Added monitor router, controller, and model
This commit is contained in:
1 parent
0abda6fd21
commit
def8ba4b9d
5 files changed
+96
-26
No files matched your search
@@ -0,0 +1,37 @@
|
||||
const mongoose = require("mongoose");
|
||||
|
||||
const MonitorSchema = mongoose.Schema({
|
||||
userId: {
|
||||
type: String,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
isActive: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
interval: {
|
||||
// in milliseconds
|
||||
type: Number,
|
||||
default: 60000,
|
||||
},
|
||||
updated_at: {
|
||||
type: Date,
|
||||
default: Date.now,
|
||||
},
|
||||
created_at: {
|
||||
type: Date,
|
||||
default: Date.now,
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = mongoose.model("Monitor", MonitorSchema);
|
||||
Reference in new issue
Block a user