Register /api/texts routes via TextController
This commit is contained in:
parent
ec32ca0103
commit
822176fcd3
1 changed files with 4 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ use Psr\Http\Message\ResponseInterface as Response;
|
|||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use DI\Bridge\Slim\Bridge;
|
||||
use App\View\ViewController;
|
||||
use App\Text\TextController;
|
||||
|
||||
$container = require __DIR__.'/container.php';
|
||||
$app = Bridge::create($container);
|
||||
|
|
@ -13,6 +14,8 @@ $app->addErrorMiddleware(true, true, true);
|
|||
|
||||
$app->get('/admin', [ViewController::class, 'admin']);
|
||||
$app->get('/admin/texts', [ViewController::class, 'texts']);
|
||||
$app->post('/admin/texts', [ViewController::class, 'createText']);
|
||||
|
||||
$app->get('/api/texts', [TextController::class, 'getTexts']);
|
||||
$app->post('/api/texts', [TextController::class, 'createText']);
|
||||
|
||||
return $app;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue