Add scribbles POST API

This commit is contained in:
Marcel Kapfer 2025-02-06 17:40:34 +01:00
parent 8d84fda8af
commit 250f072201
Signed by: mmk2410
GPG key ID: CADE6F0C09F21B09
5 changed files with 115 additions and 3 deletions

View file

@ -1,7 +1,20 @@
<?php
use Kirby\Cms\App as Kirby;
use Kirby\Filesystem\F;
F::loadClasses([
'Mmk2410\\KirbyHelpers\\RssFeed' => 'src/RssFeed.php'
'Mmk2410\\KirbyHelpers\\RssFeed' => 'src/RssFeed.php',
'Mmk2410\\KirbyHelpers\\Middleware\\ApiAuthentication' => 'src/Middleware/ApiAuthentication.php',
'Mmk2410\\KirbyHelpers\\Controller\\ScribbleController' => 'src/Controller/ScribbleController.php',
], __DIR__);
Kirby::plugin('mmk2410/kirby-helpers', [
'routes' => [
[
'pattern' => 'my/api/v1/scribble',
'action' => fn () => (new Mmk2410\KirbyHelpers\Controller\ScribbleController())->addScribble(),
'method' => 'POST'
],
]
]);