shlink/module/Rest/config/routes.config.php

91 lines
3.1 KiB
PHP
Raw Normal View History

2016-07-19 17:07:59 +02:00
<?php
2017-10-12 10:13:20 +02:00
declare(strict_types=1);
2017-07-15 09:00:53 +02:00
use Fig\Http\Message\RequestMethodInterface as RequestMethod;
2017-10-12 10:13:20 +02:00
use Shlinkio\Shlink\Rest\Action;
2016-07-19 17:07:59 +02:00
return [
'routes' => [
[
2017-07-07 13:12:45 +02:00
'name' => Action\AuthenticateAction::class,
2018-01-07 20:45:05 +01:00
'path' => '/authenticate',
'middleware' => Action\AuthenticateAction::class,
2017-07-15 09:00:53 +02:00
'allowed_methods' => [RequestMethod::METHOD_POST],
2016-07-19 17:07:59 +02:00
],
2017-07-07 13:12:45 +02:00
// Short codes
2016-07-19 17:07:59 +02:00
[
2017-07-07 13:12:45 +02:00
'name' => Action\CreateShortcodeAction::class,
2018-01-07 20:45:05 +01:00
'path' => '/short-codes',
'middleware' => Action\CreateShortcodeAction::class,
2017-07-15 09:00:53 +02:00
'allowed_methods' => [RequestMethod::METHOD_POST],
2016-07-19 17:07:59 +02:00
],
2018-05-01 10:10:19 +02:00
// [
// 'name' => Action\CreateShortcodeAction::class,
// 'path' => '/short-codes',
// 'middleware' => Action\CreateShortcodeAction::class,
// 'allowed_methods' => [RequestMethod::METHOD_GET],
// ],
2018-01-07 20:45:05 +01:00
[
'name' => Action\EditShortCodeAction::class,
'path' => '/short-codes/{shortCode}',
'middleware' => Action\EditShortCodeAction::class,
'allowed_methods' => [RequestMethod::METHOD_PUT],
],
2016-07-19 17:07:59 +02:00
[
2017-07-07 13:12:45 +02:00
'name' => Action\ResolveUrlAction::class,
2018-01-07 20:45:05 +01:00
'path' => '/short-codes/{shortCode}',
'middleware' => Action\ResolveUrlAction::class,
2017-07-15 09:00:53 +02:00
'allowed_methods' => [RequestMethod::METHOD_GET],
2016-07-19 17:07:59 +02:00
],
[
2017-07-07 13:12:45 +02:00
'name' => Action\ListShortcodesAction::class,
2018-01-07 20:45:05 +01:00
'path' => '/short-codes',
'middleware' => Action\ListShortcodesAction::class,
2017-07-15 09:00:53 +02:00
'allowed_methods' => [RequestMethod::METHOD_GET],
2016-07-19 17:07:59 +02:00
],
[
2017-07-07 13:12:45 +02:00
'name' => Action\EditShortcodeTagsAction::class,
2018-01-07 20:45:05 +01:00
'path' => '/short-codes/{shortCode}/tags',
2017-07-07 13:12:45 +02:00
'middleware' => Action\EditShortcodeTagsAction::class,
2017-07-15 09:00:53 +02:00
'allowed_methods' => [RequestMethod::METHOD_PUT],
2017-07-07 13:12:45 +02:00
],
// Visits
[
'name' => Action\GetVisitsAction::class,
2018-01-07 20:45:05 +01:00
'path' => '/short-codes/{shortCode}/visits',
'middleware' => Action\GetVisitsAction::class,
2017-07-15 09:00:53 +02:00
'allowed_methods' => [RequestMethod::METHOD_GET],
2016-07-19 17:07:59 +02:00
],
2017-07-07 13:12:45 +02:00
// Tags
[
2017-07-15 09:00:53 +02:00
'name' => Action\Tag\ListTagsAction::class,
2018-01-07 20:45:05 +01:00
'path' => '/tags',
2017-07-15 09:00:53 +02:00
'middleware' => Action\Tag\ListTagsAction::class,
'allowed_methods' => [RequestMethod::METHOD_GET],
],
[
'name' => Action\Tag\DeleteTagsAction::class,
2018-01-07 20:45:05 +01:00
'path' => '/tags',
2017-07-15 09:00:53 +02:00
'middleware' => Action\Tag\DeleteTagsAction::class,
'allowed_methods' => [RequestMethod::METHOD_DELETE],
],
[
'name' => Action\Tag\CreateTagsAction::class,
2018-01-07 20:45:05 +01:00
'path' => '/tags',
2017-07-15 09:00:53 +02:00
'middleware' => Action\Tag\CreateTagsAction::class,
'allowed_methods' => [RequestMethod::METHOD_POST],
],
2017-07-15 12:04:12 +02:00
[
'name' => Action\Tag\UpdateTagAction::class,
2018-01-07 20:45:05 +01:00
'path' => '/tags',
2017-07-15 12:04:12 +02:00
'middleware' => Action\Tag\UpdateTagAction::class,
'allowed_methods' => [RequestMethod::METHOD_PUT],
],
2016-07-19 17:07:59 +02:00
],
];