2024-07-15 22:11:43 -07:00
|
|
|
const router = require("express").Router();
|
|
|
|
|
const { verifyOwnership } = require("../middleware/verifyOwnership");
|
2024-07-15 22:43:55 -07:00
|
|
|
const Monitor = require("../models/Monitor");
|
2024-07-15 22:11:43 -07:00
|
|
|
|
2024-07-15 22:14:09 -07:00
|
|
|
/**
|
|
|
|
|
* @route POST /:monitorId
|
|
|
|
|
* @description Create a new PageSpeedCheck for a monitor
|
|
|
|
|
* @access Private
|
|
|
|
|
* @param {string} monitorId - The ID of the monitor
|
|
|
|
|
* @middleware verifyOwnership - Ensures the user owns the monitor
|
|
|
|
|
*/
|
2024-07-16 10:14:25 -07:00
|
|
|
router.post("/:monitorId", verifyOwnership(Monitor, "monitorId"), () => {
|
|
|
|
|
console.log("Create check");
|
|
|
|
|
});
|
2024-07-15 22:11:43 -07:00
|
|
|
|
2024-07-15 22:14:09 -07:00
|
|
|
/**
|
|
|
|
|
* @route GET /:monitorId
|
|
|
|
|
* @description Get all PageSpeedChecks for a monitor
|
|
|
|
|
* @access Private
|
|
|
|
|
* @param {string} monitorId - The ID of the monitor
|
|
|
|
|
* @middleware verifyOwnership - Ensures the user owns the monitor
|
|
|
|
|
*/
|
2024-07-16 10:14:25 -07:00
|
|
|
router.get("/:monitorId", verifyOwnership(Monitor, "monitorId"), () => {
|
|
|
|
|
console.log("Get checks");
|
|
|
|
|
});
|
2024-07-15 22:11:43 -07:00
|
|
|
|
2024-07-15 22:14:09 -07:00
|
|
|
/**
|
|
|
|
|
* @route POST /delete/:monitorId
|
|
|
|
|
* @description Delete all PageSpeedChecks for a monitor
|
|
|
|
|
* @access Private
|
|
|
|
|
* @param {string} monitorId - The ID of the monitor
|
|
|
|
|
* @middleware verifyOwnership - Ensures the user owns the monitor
|
|
|
|
|
*/
|
2024-07-16 10:14:25 -07:00
|
|
|
router.delete("/:monitorId", verifyOwnership(Monitor, "monitorId"), () => {
|
|
|
|
|
console.log("Delete checks");
|
|
|
|
|
});
|
2024-07-15 22:11:43 -07:00
|
|
|
|
|
|
|
|
module.exports = router;
|