Merge pull request #135 from bluewave-labs/feat/http-https-status

Implemented HTTP(s) Request, added add and delete to and from job queue, resolves #134
This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-06-14 12:58:55 -07:00
commit f3de5ce381
6 files changed
+48 -10

No files matched your search

+1
View File
@@ -24,6 +24,7 @@ const {
* @returns {String}
*/
const issueToken = (payload) => {
//TODO Add proper expiration date
return jwt.sign(payload, process.env.JWT_SECRET, { expiresIn: "99d" });
};
+4
View File
@@ -116,6 +116,8 @@ const createMonitor = async (req, res, next) => {
try {
const monitor = await req.db.createMonitor(req, res);
// Add monitor to job queue
req.jobQueue.addJob(monitor._id, monitor);
return res
.status(201)
.json({ success: true, msg: "Monitor created", data: monitor });
@@ -147,6 +149,8 @@ const deleteMonitor = async (req, res, next) => {
try {
const monitor = await req.db.deleteMonitor(req, res, next);
req.jobQueue.deleteJob(monitor);
/**
* TODO
* We should remove all checks and alerts associated with this monitor