[ [ 'aggregate' => true, 'method' => 'GET', 'path' => '/v1/devices/{mac}/details', 'actions' => [ 'device' => [ 'service' => 'core', 'method' => 'GET', 'path' => 'devices/{mac}', 'sequence' => 0, 'critical' => true ], 'ping' => [ 'service' => 'history', 'output_key' => false, 'method' => 'POST', 'path' => '/{mac}/ping', 'sequence' => 0, 'critical' => false ], 'settings' => [ 'service' => 'core', 'output_key' => 'network.settings', 'method' => 'GET', 'path' => 'networks/{device%network_id}', 'sequence' => 1, 'critical' => false ] ] ] ], ]; $sections = ['services', 'routes', 'global']; foreach ($sections as $section) { $config = env('GATEWAY_' . strtoupper($section), false); ${$section} = $config ? json_decode($config, true) : $configTemplate[$section]; } return compact($sections); })();