Changed way to connect to api

This commit is contained in:
2022-11-30 10:40:36 -03:00
parent f8500e061c
commit a5d97729dc
12 changed files with 129 additions and 43 deletions

View File

@ -2,7 +2,12 @@
return [
'urls' => function() {
$arr = ['base' => $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST']];
$arr['api'] = 'http://localhost:8080';
$arr['api'] = $_ENV['API_URI'];
return (object) $arr;
}
},
'view_urls' => function() {
$arr = ['base' => $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST']];
$arr['api'] = implode('/', [$arr['base'], 'api']);
return (object) $arr;
},
];

View File

@ -11,5 +11,8 @@ return [
]
]
]);
}
},
Psr\Http\Message\RequestFactoryInterface::class => function(ContainerInterface $container) {
return $container->get(Nyholm\Psr7\Factory\Psr17Factory::class);
},
];

View File

@ -2,13 +2,13 @@
use Psr\Container\ContainerInterface;
return [
\Slim\Views\Blade::class => function(ContainerInterface $container) {
return new \Slim\Views\Blade(
Slim\Views\Blade::class => function(ContainerInterface $container) {
return new Slim\Views\Blade(
$container->get('folders')->views,
$container->get('folders')->cache,
null,
[
'urls' => $container->get('urls'),
'urls' => $container->get('view_urls'),
'api_key' => $container->get('api_key')
]
);