How to make /app/api/getcustomerall
accessible only by logged in users
My code
// API Action event
function Api_Action($app)
{
// All
$app->get('/getcustomerall', function ($request, $response, $args) {
$responsemail = $response->withJson(ExecuteRows("SELECT email FROM users ORDER BY email ASC")); // Select the record by name and return as JSON
return $responsemail ; // Return Psr\\Http\\Message\\ResponseInterface object
});
}