mirror of
https://github.com/notrab/dumbo.git
synced 2025-01-17 06:08:31 +01:00
20 lines
342 B
PHP
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();
|