From b6665c8f9c527df1d00ba1f33c549ca5dc997435 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Fri, 26 Mar 2021 16:33:36 +0000 Subject: [PATCH] Local settings --- config/locations.php | 2 +- setup/api/config.php | 3 +++ setup/app.php | 2 +- setup/common/config.php | 2 +- setup/env/config.php | 3 ++- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config/locations.php b/config/locations.php index 05442b6..f0a3c43 100644 --- a/config/locations.php +++ b/config/locations.php @@ -11,6 +11,6 @@ return [ 'controllers' => '{locations.app}/Controller', 'money' => 'provm.cl/optimus/money', 'api' => '192.168.1.100/intranet/api', - 'api_url' => '/api' + 'api_url' => '/incoviba/api' ]; ?> diff --git a/setup/api/config.php b/setup/api/config.php index f7839c9..d32fc72 100644 --- a/setup/api/config.php +++ b/setup/api/config.php @@ -2,6 +2,9 @@ use Psr\Container\ContainerInterface as Container; return [ + 'base_url' => DI\decorate(function($prev, Container $c) { + return $prev . '/api'; + }), 'locations' => DI\decorate(function($prev, Container $c) { $arr = (array) $prev; $arr['cache'] = $prev->base . '/cache'; diff --git a/setup/app.php b/setup/app.php index 6f23ef1..333dc42 100644 --- a/setup/app.php +++ b/setup/app.php @@ -30,7 +30,7 @@ foreach ($files as $file) { $container = $builder->build(); $app = Bridge::create($container); -$app->setBasePath('/api'); +$app->setBasePath($app->getContainer()->get('base_url')); $app->addRoutingMiddleware(); foreach ($folders as $folder) { diff --git a/setup/common/config.php b/setup/common/config.php index 71205fa..d216b5f 100644 --- a/setup/common/config.php +++ b/setup/common/config.php @@ -10,7 +10,7 @@ return [ 'databases' => function() { $arr = [ 'mysql' => [ - 'host' => 'db', + 'host' => 'localhost', //'port' => 3306, 'database' => 'incoviba', 'username' => 'incoviba', diff --git a/setup/env/config.php b/setup/env/config.php index eadf7ed..48b0973 100644 --- a/setup/env/config.php +++ b/setup/env/config.php @@ -1,5 +1,6 @@ false, - 'benchmark' => false + 'benchmark' => false, + 'base_url' => '/incoviba' ];