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

77 lines
2.8 KiB
PHP
Raw Normal View History

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