mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-09 06:48:47 +00:00
Retrieve ping url from config rather than as query parameter
This commit is contained in:
parent
0d6ccb036e
commit
1fb7be7457
7 changed files with 35 additions and 24 deletions
|
@ -1,12 +1,22 @@
|
|||
import { performance } from "perf_hooks";
|
||||
|
||||
import { getServiceItem } from "utils/config/service-helpers";
|
||||
import createLogger from "utils/logger";
|
||||
import { httpProxy } from "utils/proxy/http";
|
||||
|
||||
const logger = createLogger("ping");
|
||||
|
||||
export default async function handler(req, res) {
|
||||
const { ping: pingURL } = req.query;
|
||||
const { group, service } = req.query;
|
||||
const serviceItem = await getServiceItem(group, service);
|
||||
if (!serviceItem) {
|
||||
logger.debug(`No service item found for group ${group} named ${service}`);
|
||||
return res.status(400).send({
|
||||
error: "Unable to find service, see log for details.",
|
||||
});
|
||||
}
|
||||
|
||||
const { ping: pingURL } = serviceItem;
|
||||
|
||||
if (!pingURL) {
|
||||
logger.debug("No ping URL specified");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue