PHP code example of marcguyer / version-middleware
1. Go to this page and download the library: Download marcguyer/version-middleware library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
marcguyer / version-middleware example snippets
...
$app->pipe(ServerUrlMiddleware::class);
...
$app->pipe(Psr7Versioning\VersionMiddleware::class);
...
$app->pipe(RouteMiddleware::class);
...
$app->get('/api/v1/ping', Api\Handler\PingHandler::class, 'api.ping');
$app->get('/api/v2/ping', Api\V2\Handler\PingHandler::class, 'api.v2.ping');