Releases: bedita/web-tools
Release 3.1.3
Fix setting base url inApiProxyTrait
when the URL of request was encoded.
Release 3.1.2
Fix issue with relationships mask.
Release 3.1.1
Fix ApiProxyTrait
to avoid that every variable set for view is serialized in JSON output.
Release 2.4.2
Backport of fix in 3.1.2
Release 2.4.1
Backport of fix in 3.1.1 version
Release 1.4.2
Backport of fix in 3.1.2
Release 1.4.1
Backport of fix in 3.1.1 version
Release 2.4.0
Backport of ApiProxyTrait
to 2.x branch. See Release 3.1.0
Release 1.4.0
Backport of ApiProxyTrait
to 1.x branch. See Release 3.1.0
Release 3.1.0
Main changes are:
-
introduction of
ApiProxyTrait
to easily proxy requests to BEdita4 API in a controller. Only GET request are supported for now.
To enable it create a controller asuse BEdita\WebTools\Controller\ApiProxyTrait; use App\Controller\AppController; class ApiController extends AppController { use ApiProxyTrait; }
and define the routing rule
$routes->scope('/api', ['_namePrefix' => 'api:'], function (RouteBuilder $routes) { $routes->get('/**', ['controller' => 'Api', 'action' => 'get'], 'get'); });
Then you can do requests to
/api/*
route (for example viaGET /api/users
) obtaining the raw json response from the API. In the response the URL of the API will be masked with the app URL.