add server software
This commit is contained in:
@@ -15,6 +15,8 @@ ini_set("display_startup_errors", 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
class mcServApi {
|
||||
private $api_keys;
|
||||
|
||||
public function getConf() {
|
||||
$env = parse_ini_file(__DIR__ . "/../.env");
|
||||
return $env;
|
||||
|
||||
18
api/servers/server_software_list.php
Normal file
18
api/servers/server_software_list.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
require "../api.php";
|
||||
|
||||
$api = new mcServApi();
|
||||
|
||||
if (!$api->checkAuth()) {
|
||||
die('{"status":"500", "error":"Unauthorized"}');
|
||||
}
|
||||
|
||||
$config = $api->getConf();
|
||||
|
||||
$file = file_get_contents($config["PATH"]. "/assets/server_software.json");
|
||||
|
||||
$json["status"] = 200;
|
||||
$json["server_software"] = json_decode($file, true);
|
||||
|
||||
die(json_encode($json, JSON_UNESCAPED_SLASHES));
|
||||
?>
|
||||
Reference in New Issue
Block a user