mirror of
https://github.com/danog/TelegramApiServer.git
synced 2024-11-26 20:04:45 +01:00
Trailing slashes in routes support
This commit is contained in:
parent
8a74979cd7
commit
4a8057c0bf
@ -46,10 +46,10 @@ class Server
|
||||
{
|
||||
$router = new Amp\Http\Server\Router();
|
||||
foreach (['GET', 'POST'] as $method) {
|
||||
$router->addRoute($method, '/api/{session}/{method}', ApiController::getRouterCallback($client));
|
||||
$router->addRoute($method, '/api/{method}', ApiController::getRouterCallback($client));
|
||||
|
||||
$router->addRoute($method, '/events[/{session}]', EventsController::getRouterCallback($client));
|
||||
$router->addRoute($method, '/api/{session}/{method}[/]', ApiController::getRouterCallback($client));
|
||||
$router->addRoute($method, '/api/{method}[/]', ApiController::getRouterCallback($client));
|
||||
$router->addRoute($method, '/events/{session}[/]', EventsController::getRouterCallback($client));
|
||||
$router->addRoute($method, '/events[/]', EventsController::getRouterCallback($client));
|
||||
}
|
||||
|
||||
$router->setFallback(new CallableRequestHandler(static function (Request $request) {
|
||||
|
Loading…
Reference in New Issue
Block a user