Explorar o código

added kuma data route

Henry Whitaker %!s(int64=3) %!d(string=hai) anos
pai
achega
732c4a451c
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      api/v2/routes/homepage.php

+ 8 - 0
api/v2/routes/homepage.php

@@ -308,6 +308,14 @@ $app->get('/homepage/monitorr/data', function ($request, $response, $args) {
 		->withHeader('Content-Type', 'application/json;charset=UTF-8')
 		->withStatus($GLOBALS['responseCode']);
 });
+$app->get('/homepage/kuma/data', function ($request, $response, $args) {
+	$Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
+	$Organizr->getUptimeKumaHomepageData();
+	$response->getBody()->write(jsonE($GLOBALS['api']));
+	return $response
+		->withHeader('Content-Type', 'application/json;charset=UTF-8')
+		->withStatus($GLOBALS['responseCode']);
+});
 $app->get('/homepage/speedtest/data', function ($request, $response, $args) {
 	$Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
 	$Organizr->getSpeedtestHomepageData();