$app->add(new Tuupola\Middleware\HttpBasicAuthentication([
"path" => "/api",
"realm" => "Protected",
"users" => [
"Username" => "kavi",
"password" => "0000"
],
"error" => function ($response, $arguments) {
echo "false";
$data = [];
$data["status"] = "error";
$data["message"] = $arguments["message"];
// return $response->write(json_encode($data, JSON_UNESCAPED_SLASHES));
},
"success"=>function($response, $arguments){
echo "true";
}
]));