Files
Checkmate/Server/routes/pageSpeedCheckRoute.js
T
2024-07-16 10:14:25 -07:00

39 lines
1.2 KiB
JavaScript

const router = require("express").Router();
const { verifyOwnership } = require("../middleware/verifyOwnership");
const Monitor = require("../models/Monitor");
/**
* @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
*/
router.post("/:monitorId", verifyOwnership(Monitor, "monitorId"), () => {
console.log("Create check");
});
/**
* @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
*/
router.get("/:monitorId", verifyOwnership(Monitor, "monitorId"), () => {
console.log("Get checks");
});
/**
* @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
*/
router.delete("/:monitorId", verifyOwnership(Monitor, "monitorId"), () => {
console.log("Delete checks");
});
module.exports = router;