diff --git a/app/app.php b/app/app.php index 64a4967568..49bedfed2b 100644 --- a/app/app.php +++ b/app/app.php @@ -3,7 +3,7 @@ // Init require_once __DIR__.'/init.php'; -global $utopia, $request, $response, $register, $consoleDB, $project, $service; +global $utopia, $request, $response, $register, $consoleDB, $project; use Utopia\App; use Utopia\Request; @@ -426,14 +426,8 @@ $utopia->get('/.well-known/acme-challenge') } ); -$name = APP_NAME; - -if (\array_key_exists($service, $services)) { /** @noinspection PhpIncludeInspection */ - include_once $services[$service]['controller']; - $name = APP_NAME.' '.\ucfirst($services[$service]['name']); -} else { - /** @noinspection PhpIncludeInspection */ - include_once $services['/']['controller']; +foreach($services as $key => $service) { + include_once $services[$key]['controller']; } $utopia->run($request, $response); \ No newline at end of file diff --git a/public/index.php b/public/index.php index 9e30f0ef56..c87b14a26e 100644 --- a/public/index.php +++ b/public/index.php @@ -20,14 +20,4 @@ $path = (isset($_GET['q'])) ? explode('/', $_GET['q']) : []; array_shift($path); $version = array_shift($path); -switch ($version) { // Switch between API version - case 'v1': - $service = $version . '/' . array_shift($path); - include __DIR__ . '/../app/app.php'; - break; - case 'console': - default: - $service = $version . '/'; - include __DIR__ . '/../app/app.php'; - break; -} +include __DIR__ . '/../app/app.php';