* active flag is now working as intended * iframe slide type added * team-slide connection is now many-to-many
51 lines
2.0 KiB
PHP
Executable File
51 lines
2.0 KiB
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Psr\Container\ContainerInterface;
|
|
use Zend\Expressive\Application;
|
|
use Zend\Expressive\MiddlewareFactory;
|
|
|
|
/**
|
|
* Setup routes with a single request method:
|
|
*
|
|
* $app->get('/', App\Handler\HomePageHandler::class, 'home');
|
|
* $app->post('/album', App\Handler\AlbumCreateHandler::class, 'album.create');
|
|
* $app->put('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.put');
|
|
* $app->patch('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.patch');
|
|
* $app->delete('/album/:id', App\Handler\AlbumDeleteHandler::class, 'album.delete');
|
|
*
|
|
* Or with multiple request methods:
|
|
*
|
|
* $app->route('/contact', App\Handler\ContactHandler::class, ['GET', 'POST', ...], 'contact');
|
|
*
|
|
* Or handling all request methods:
|
|
*
|
|
* $app->route('/contact', App\Handler\ContactHandler::class)->setName('contact');
|
|
*
|
|
* or:
|
|
*
|
|
* $app->route(
|
|
* '/contact',
|
|
* App\Handler\ContactHandler::class,
|
|
* Zend\Expressive\Router\Route::HTTP_METHOD_ANY,
|
|
* 'contact'
|
|
* );
|
|
*/
|
|
return function (Application $app, MiddlewareFactory $factory, ContainerInterface $container) : void {
|
|
$app->get('/', App\Handler\HomePageHandler::class, 'home');
|
|
$app->get('/api/ping', App\Handler\PingHandler::class, 'api.ping');
|
|
|
|
$app->get('/api/team', App\Handler\TeamHandler::class,'api.team.list');
|
|
$app->get('/api/team/{id:\d+}', App\Handler\TeamHandler::class,'api.team.get');
|
|
$app->post('/api/team', App\Handler\TeamHandler::class,'api.team.add');
|
|
$app->put('/api/team[/{id:\d+}]', App\Handler\TeamHandler::class,'api.team.change');
|
|
$app->delete('/api/team/{id:\d+}', App\Handler\TeamHandler::class,'api.team.delete');
|
|
|
|
$app->put('/api/slide-position/{id:\d+}', App\Handler\SlidePositionHandler::class,'api.slide.position');
|
|
$app->route('/api/slide[/{id:\d+}]', App\Handler\SlideHandler::class)->setName('api.slide');
|
|
|
|
$app->get('/avatars/{signum}', App\Handler\AvatarHandler::class,'avatar.image');
|
|
$app->get('/api/kanban/{teamId:\d+}', App\Handler\KanbanHandler::class,'api.team.kanban');
|
|
};
|