require slim; create slim app
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Lexi / Zoe 2020-06-28 18:16:06 +02:00
parent 9095a604a2
commit c344dce8eb
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
5 changed files with 643 additions and 5 deletions

View file

@ -3,7 +3,18 @@ declare(strict_types=1);
require_once __DIR__ . '/../vendor/autoload.php';
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Factory\AppFactory;
use NoteCat\HelloWorld;
$hello = new HelloWorld();
echo '<b>' . $hello->getHello() . "</b>\n";
$app = AppFactory::create();
$app->get('/', function (Request $request, Response $response, $args) {
$hello = new HelloWorld();
$response->getBody()->write('<b>' . $hello->getHello() . "</b>\n");
return $response;
});
$app->run();