Use all controllers

This commit is contained in:
Eldad Fux 2020-06-25 14:31:27 +03:00
parent 1e3472b724
commit 7a277c3b6a
2 changed files with 4 additions and 20 deletions

View file

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

View file

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