mirror of
https://github.com/notrab/dumbo.git
synced 2025-01-17 22:28:25 +01:00
25 lines
466 B
PHP
25 lines
466 B
PHP
<?php
|
|
|
|
require "vendor/autoload.php";
|
|
|
|
use Dumbo\Dumbo;
|
|
use Dumbo\Helpers\BasicAuth;
|
|
|
|
$app = new Dumbo();
|
|
|
|
$app->use(
|
|
BasicAuth::basicAuth([
|
|
"users" => [
|
|
["username" => "user1", "password" => "pass1"],
|
|
["username" => "user2", "password" => "pass2"],
|
|
],
|
|
"realm" => "Admin Area",
|
|
])
|
|
);
|
|
|
|
$app->get("/", function ($context) {
|
|
return $context->html("<h1>Welcome to the protected area!</h1>");
|
|
});
|
|
|
|
$app->run();
|