2024-09-08 09:24:05 +01:00

20 lines
342 B
PHP

<?php
require __DIR__ . "/vendor/autoload.php";
use Dumbo\Dumbo;
use Dumbo\Helpers\BearerAuth;
$app = new Dumbo();
$token = "mysupersecret";
$app->use(BearerAuth::bearerAuth($token));
$app->get("/", function ($context) {
return $context->json([
"message" => "Protected route accessed successfully",
]);
});
$app->run();