Add default site monitor url to be the services href
This commit is contained in:
parent
97d7ae21e4
commit
dcab06061e
@ -16,14 +16,26 @@ export default async function handler(req, res) {
|
||||
});
|
||||
}
|
||||
|
||||
const { siteMonitor: monitorURL } = serviceItem;
|
||||
const { href, siteMonitor } = serviceItem;
|
||||
|
||||
if (!monitorURL) {
|
||||
if (!siteMonitor) {
|
||||
logger.debug("No http monitor URL specified");
|
||||
return res.status(400).send({
|
||||
error: "No http monitor URL given",
|
||||
});
|
||||
}
|
||||
let monitorURL = siteMonitor;
|
||||
|
||||
if (siteMonitor === true) {
|
||||
// if monitor is set to "true", use the href as the monitor target
|
||||
if (!href) {
|
||||
logger.error(`Monitoring requestd for service '${service}' but no url specified.\n\tEither set monitor to a url or set href`);
|
||||
return res.status(400).send({
|
||||
error: "No url specified for monitor, see logs.",
|
||||
});
|
||||
}
|
||||
monitorURL = href;
|
||||
}
|
||||
|
||||
try {
|
||||
let startTime = performance.now();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user