2016-04-10 02:38:07 -05:00
|
|
|
<?php
|
2019-10-05 10:26:10 -05:00
|
|
|
|
2017-10-12 03:13:20 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2018-11-18 10:00:23 -06:00
|
|
|
use Fig\Http\Message\RequestMethodInterface as RequestMethod;
|
2018-10-18 13:19:22 -05:00
|
|
|
use RKA\Middleware\IpAddress;
|
2016-08-09 03:24:42 -05:00
|
|
|
use Shlinkio\Shlink\Core\Action;
|
2016-08-09 06:41:30 -05:00
|
|
|
use Shlinkio\Shlink\Core\Middleware;
|
2016-04-10 02:38:07 -05:00
|
|
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
'routes' => [
|
2016-04-30 11:59:03 -05:00
|
|
|
[
|
2019-11-02 12:36:15 -05:00
|
|
|
'name' => Action\RedirectAction::class,
|
2016-04-30 11:59:03 -05:00
|
|
|
'path' => '/{shortCode}',
|
2018-10-18 13:19:22 -05:00
|
|
|
'middleware' => [
|
|
|
|
IpAddress::class,
|
|
|
|
Action\RedirectAction::class,
|
|
|
|
],
|
2018-11-18 10:00:23 -06:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_GET],
|
2016-08-09 03:24:42 -05:00
|
|
|
],
|
2018-03-26 13:13:03 -05:00
|
|
|
[
|
2019-11-02 12:36:15 -05:00
|
|
|
'name' => Action\PixelAction::class,
|
2018-03-26 13:13:03 -05:00
|
|
|
'path' => '/{shortCode}/track',
|
2018-10-18 13:19:22 -05:00
|
|
|
'middleware' => [
|
|
|
|
IpAddress::class,
|
|
|
|
Action\PixelAction::class,
|
|
|
|
],
|
2018-11-18 10:00:23 -06:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_GET],
|
2018-03-26 13:13:03 -05:00
|
|
|
],
|
2016-08-09 03:24:42 -05:00
|
|
|
[
|
2019-11-02 12:36:15 -05:00
|
|
|
'name' => Action\QrCodeAction::class,
|
2016-08-18 04:31:04 -05:00
|
|
|
'path' => '/{shortCode}/qr-code[/{size:[0-9]+}]',
|
2016-08-09 06:41:30 -05:00
|
|
|
'middleware' => [
|
|
|
|
Middleware\QrCodeCacheMiddleware::class,
|
|
|
|
Action\QrCodeAction::class,
|
|
|
|
],
|
2018-11-18 10:00:23 -06:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_GET],
|
2016-04-30 11:59:03 -05:00
|
|
|
],
|
2019-08-09 11:12:33 -05:00
|
|
|
|
|
|
|
// Deprecated routes
|
2016-08-18 04:10:15 -05:00
|
|
|
[
|
|
|
|
'name' => 'short-url-preview',
|
|
|
|
'path' => '/{shortCode}/preview',
|
|
|
|
'middleware' => Action\PreviewAction::class,
|
2018-11-18 10:00:23 -06:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_GET],
|
2016-08-18 04:10:15 -05:00
|
|
|
],
|
2016-08-18 04:31:04 -05:00
|
|
|
[
|
|
|
|
'name' => 'short-url-qr-code-old',
|
|
|
|
'path' => '/qr/{shortCode}[/{size:[0-9]+}]',
|
|
|
|
'middleware' => [
|
|
|
|
Middleware\QrCodeCacheMiddleware::class,
|
|
|
|
Action\QrCodeAction::class,
|
|
|
|
],
|
2018-11-18 10:00:23 -06:00
|
|
|
'allowed_methods' => [RequestMethod::METHOD_GET],
|
2016-08-18 04:31:04 -05:00
|
|
|
],
|
2016-04-10 02:38:07 -05:00
|
|
|
],
|
2016-04-17 12:34:16 -05:00
|
|
|
|
2016-04-10 02:38:07 -05:00
|
|
|
];
|