mirror of
https://github.com/stronk-dev/LivepeerEvents.git
synced 2025-07-05 18:55:09 +02:00
Added new endpoint for getting Orch info
This commit is contained in:
parent
0f15927376
commit
2c3b493349
@ -311,13 +311,26 @@ const parseOrchestrator = async function (reqAddr) {
|
|||||||
orchestratorCache.push(orchestratorObj);
|
orchestratorCache.push(orchestratorObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(orchestratorObj);
|
|
||||||
return orchestratorObj;
|
return orchestratorObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
apiRouter.get("/getOrchestrator", async (req, res) => {
|
apiRouter.get("/getOrchestrator", async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const reqObj = await parseOrchestrator(defaultOrch);
|
let reqOrch = req.query.orch;
|
||||||
|
if (!reqOrch || reqOrch == ""){
|
||||||
|
reqOrch = defaultOrch;
|
||||||
|
}
|
||||||
|
const reqObj = await parseOrchestrator(reqOrch);
|
||||||
|
res.send(reqObj);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
res.status(400).send(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
apiRouter.get("/getOrchestrator/:orch", async (req, res) => {
|
||||||
|
try {
|
||||||
|
const reqObj = await parseOrchestrator(req.params.orch);
|
||||||
res.send(reqObj);
|
res.send(reqObj);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user