Files
Checkmate/Server/models/Monitor.js
T

45 lines
776 B
JavaScript
Raw Normal View History

2024-05-10 13:36:04 -07:00
const mongoose = require("mongoose");
const MonitorSchema = mongoose.Schema(
{
userId: {
type: mongoose.Schema.Types.ObjectId,
ref: "User",
immutable: true,
},
name: {
type: String,
required: true,
},
description: {
type: String,
},
status: {
type: Boolean,
default: true,
},
type: {
type: String,
required: true,
2024-07-24 10:42:38 -07:00
enum: ["http", "ping", "pagespeed"],
},
url: {
type: String,
required: true,
},
isActive: {
type: Boolean,
default: true,
},
interval: {
// in milliseconds
type: Number,
default: 60000,
},
},
{
timestamps: true,
}
);
2024-05-10 13:36:04 -07:00
module.exports = mongoose.model("Monitor", MonitorSchema);