Files
Checkmate/Server/routes/pageSpeedCheckRoute.js
T

50 lines
1.3 KiB
JavaScript
Raw Normal View History

2024-07-15 22:11:43 -07:00
const router = require("express").Router();
const { verifyOwnership } = require("../middleware/verifyOwnership");
const PageSpeedCheck = require("../models/PageSpeedCheck");
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-15 22:11:43 -07:00
router.post(
"/:monitorId",
verifyOwnership(PageSpeedCheck, "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-15 22:11:43 -07:00
router.get(
"/:monitorId",
verifyOwnership(PageSpeedCheck, "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-15 22:11:43 -07:00
router.post(
"/delete/:monitorId",
verifyOwnership(PageSpeedCheck, "monitorId"),
() => {
console.log("Delete checks");
}
2024-07-15 22:11:43 -07:00
);
module.exports = router;