22 lines
478 B
PHP
22 lines
478 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Hyperf\HttpMessage\Server\Response;
|
|
use Hyperf\HttpServer\Router\Router;
|
|
|
|
Router::addRoute(['POST', 'HEAD'], '/', 'App\Controller\IndexController@index');
|
|
|
|
Router::get('/', function () {
|
|
return (new Response())
|
|
->withStatus(302)
|
|
->withHeader('Location', '/super/');
|
|
});
|
|
|
|
Router::get('/favicon.ico', function () {
|
|
return '';
|
|
});
|
|
|
|
Router::addServer('ws', function () {
|
|
Router::get('/ws', 'App\Event\WebSocket');
|
|
}); |