From 4007b99833bd24a7439290d59934d4385014b59d Mon Sep 17 00:00:00 2001 From: Gregory Ballantine Date: Sat, 24 Sep 2022 22:10:23 -0400 Subject: [PATCH] Added some more server info to the server status API --- src/routes.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes.php b/src/routes.php index 558a876..3cf6c3a 100644 --- a/src/routes.php +++ b/src/routes.php @@ -76,7 +76,9 @@ $app->get('/server/{serverName}/status', function (Request $request, Response $r // create server object and pass info back to client as JSON data $server = new Server($serverDir); $serverData = [ - 'state' => $server->getState() ? 'Running' : 'Stopped', + 'name' => $server->getName(), + 'version' => $server->getVersion(), + 'state' => $server->getState() ? 'Running' : 'Stopped', ]; $response->getBody()->write(json_encode($serverData));