-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.php
23 lines (19 loc) · 907 Bytes
/
routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php declare(strict_types=1);
namespace Room11\Platter;
use Aerys\Request;
use Aerys\Response;
use Room11\Platter\Presentation\Controller\Index as IndexController;
use Room11\Platter\Presentation\Controller\Authentication as AuthenticationController;
use Room11\Platter\WebSocket\Handler;
use Room11\Platter\WebSocket\Client\Collection as ClientCollection;
use function Aerys\websocket;
$router = \Aerys\router();
$router
->route('GET', '/', function(Request $request, Response $response) use ($template) {
(new IndexController)->index($response, $template);
})
->route('POST', '/login', function(Request $request, Response $response) use ($requests, $template, $administrators) {
yield from (new AuthenticationController)->logIn($request, $response, $requests, $template, $administrators);
})
->route('GET', '/ws', websocket(new Handler(new ClientCollection())))
;