Changed way to connect to api
This commit is contained in:
18
ui/setup/setups/02_api.php
Normal file
18
ui/setup/setups/02_api.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
use Psr\Container\ContainerInterface;
|
||||
|
||||
return [
|
||||
Psr\Http\Client\ClientInterface::class => function(ContainerInterface $container) {
|
||||
return new GuzzleHttp\Client([
|
||||
'base_uri' => "http://proxy:8080",
|
||||
'headers' => [
|
||||
'Authorization' => [
|
||||
"Bearer {$container->get('api_key')}"
|
||||
]
|
||||
]
|
||||
]);
|
||||
},
|
||||
Psr\Http\Message\RequestFactoryInterface::class => function(ContainerInterface $container) {
|
||||
return $container->get(Nyholm\Psr7\Factory\Psr17Factory::class);
|
||||
},
|
||||
];
|
Reference in New Issue
Block a user