Added log page and log api

This commit is contained in:
Pinga 2023-08-30 16:10:49 +03:00
parent 5133b005a5
commit b245bae65a
3 changed files with 98 additions and 63 deletions

View file

@ -79,6 +79,23 @@ $app->any('/api[/{params:.*}]', function (
return $response;
});
$app->any('/log-api[/{params:.*}]', function (
ServerRequest $request,
Response $response,
$args
) use ($container) {
$db = config('connections');
$config = new Config([
'username' => $db['mysql']['username'],
'password' => $db['mysql']['password'],
'database' => 'registryTransaction',
'basePath' => '/log-api',
]);
$api = new Api($config);
$response = $api->handle($request);
return $response;
});
$app->add(function (Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Server\RequestHandlerInterface $handler) {
try {
return $handler->handle($request);