magnetico-web/config/routes.yaml
2018-06-26 20:48:52 +03:00

60 lines
1.3 KiB
YAML

# Basic Front-End
index:
path: /
controller: App\Controller\MainController::index
torrents_search:
path: /torrents
controller: App\Controller\TorrentController::searchTorrent
requirements:
method: GET
torrents_show:
path: /torrents/{id}
controller: App\Controller\TorrentController::showTorrent
requirements:
method: GET
id: '\d+'
user_register:
path: /register/{inviteCode}
controller: App\Controller\UserController::register
requirements:
method: GET
inviteCode: \w{32}
user_login:
path: /login
controller: App\Controller\SecurityController::login
user_logout:
path: /logout
# API
api_v1_login:
path: /api/v1/login
controller: App\Api\V1\Controller\SecurityController::login
defaults:
_format: json
requirements:
method: POST
_format: json
api_v1_torrents:
path: /api/v1/torrents
controller: App\Api\V1\Controller\TorrentController::search
defaults:
_format: json
requirements:
method: GET
_format: json
api_v1_torrents_show:
path: /api/v1/torrents/{id}
controller: App\Api\V1\Controller\TorrentController::show
defaults:
_format: json
requirements:
method: GET
_format: json
id: '\d+'