Added some more server info to the server status API

This commit is contained in:
Gregory Ballantine 2022-09-24 22:10:23 -04:00
parent efde09025c
commit 4007b99833

View File

@ -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));