2024-08-29 16:09:38 +01:00

20 lines
331 B
PHP

<?php
require "vendor/autoload.php";
use Dumbo\Dumbo;
use Dumbo\Helpers\BasicAuth;
$app = new Dumbo();
$api = new Dumbo();
$api->use(BasicAuth::basicAuth("user:password"));
$api->get("/", function ($context) {
return $context->html("<h1>Welcome to the protected area!</h1>");
});
$app->route("/api", $api);
$app->run();