'production', ... ); $app = new \Slim\Slim(array( 'mode' => 'development', 'log.enabled' => true, 'log.level' => \Slim\Log::ERROR, 'debug' => true)); $app->setName('opengnsys'); // Global variables. $userid = NULL; // User id. with access to REST API. // Common funtions and routes. include("common.php"); // Check if services are running. $config = parse_ini_file("/etc/default/opengnsys"); // If server is running, include its routes and OGAgent push routes. if ($config['RUN_OGADMSERVER'] === "yes") { include("server.php"); include("ogagent.php"); include("remotepc.php"); } // If repository is running, include its routes. if ($config['RUN_OGADMREPO'] === "yes") { include("repository.php"); } // Showing API information page using Swagger-UI. $app->get('/', function() use ($app) { $app->response->redirect('swagger-ui/index.html?url=../../opengnsys-api.yml'); } ); // Execute REST using Slim. $app->run(); ?>