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

91 lines
3.1 KiB
PHP
Raw Normal View History

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