mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-09 16:53:11 +08:00
Moved routes config together, and ensure they are loaded last
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Fig\Http\Message\RequestMethodInterface as RequestMethod;
|
||||
use RKA\Middleware\IpAddress;
|
||||
use Shlinkio\Shlink\Core\Action;
|
||||
|
||||
return [
|
||||
|
||||
'routes' => [
|
||||
[
|
||||
'name' => Action\RobotsAction::class,
|
||||
'path' => '/robots.txt',
|
||||
'middleware' => [
|
||||
Action\RobotsAction::class,
|
||||
],
|
||||
'allowed_methods' => [RequestMethod::METHOD_GET],
|
||||
],
|
||||
[
|
||||
'name' => Action\PixelAction::class,
|
||||
'path' => '/{shortCode:.+}/track',
|
||||
'middleware' => [
|
||||
IpAddress::class,
|
||||
Action\PixelAction::class,
|
||||
],
|
||||
'allowed_methods' => [RequestMethod::METHOD_GET],
|
||||
],
|
||||
[
|
||||
'name' => Action\QrCodeAction::class,
|
||||
'path' => '/{shortCode:.+}/qr-code',
|
||||
'middleware' => [
|
||||
Action\QrCodeAction::class,
|
||||
],
|
||||
'allowed_methods' => [RequestMethod::METHOD_GET],
|
||||
],
|
||||
[
|
||||
'name' => Action\RedirectAction::class,
|
||||
'path' => '/{shortCode:.+}',
|
||||
'middleware' => [
|
||||
IpAddress::class,
|
||||
Action\RedirectAction::class,
|
||||
],
|
||||
'allowed_methods' => [RequestMethod::METHOD_GET],
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
@@ -22,8 +22,7 @@ class ConfigProviderTest extends TestCase
|
||||
{
|
||||
$config = ($this->configProvider)();
|
||||
|
||||
self::assertCount(5, $config);
|
||||
self::assertArrayHasKey('routes', $config);
|
||||
self::assertCount(4, $config);
|
||||
self::assertArrayHasKey('dependencies', $config);
|
||||
self::assertArrayHasKey('entity_manager', $config);
|
||||
self::assertArrayHasKey('events', $config);
|
||||
|
||||
Reference in New Issue
Block a user