add Dependencies and Routes classes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c344dce8eb
commit
7cc2d40660
6 changed files with 288 additions and 12 deletions
|
|
@ -3,18 +3,13 @@ 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 NoteCat\Dependencies;
|
||||
use NoteCat\Routes;
|
||||
use Slim\Factory\AppFactory;
|
||||
|
||||
use NoteCat\HelloWorld;
|
||||
$container = Dependencies::createContainer();
|
||||
$app = AppFactory::createFromContainer($container);
|
||||
|
||||
$app = AppFactory::create();
|
||||
|
||||
$app->get('/', function (Request $request, Response $response, $args) {
|
||||
$hello = new HelloWorld();
|
||||
$response->getBody()->write('<b>' . $hello->getHello() . "</b>\n");
|
||||
return $response;
|
||||
});
|
||||
Routes::setRoutes($app);
|
||||
|
||||
$app->run();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue