Get rid of test route function.

This commit is contained in:
M M
2024-08-06 19:35:49 -07:00
parent 66d101877a
commit 67711ffe2c

View File

@@ -25,28 +25,4 @@ router.post(
checkController.deleteChecks
);
// Temporary test route
router.post("/test-notification/:monitorId", async (req, res) => {
try {
const monitorId = req.params.monitorId;
const monitor = await Monitor.findById(monitorId);
if (!monitor) {
return res.status(404).json({ message: "Monitor not found" });
}
const newCheck = new Check({
monitorId,
status: false,
responseTime: 100,
statusCode: 500,
message: "Server error"
});
await newCheck.save();
res.status(201).json({ message: "Check created and email notification sent" });
} catch (error) {
res.status(500).json({ message: error.message });
}
});
module.exports = router;