2021-03-01 02:04:54 +01:00
|
|
|
<?php
|
2021-03-25 22:05:32 +01:00
|
|
|
require __DIR__ . "/vendor/autoload.php";
|
|
|
|
|
2021-03-01 02:04:54 +01:00
|
|
|
use Psr\Http\Message\ResponseInterface as Response;
|
|
|
|
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
|
|
use Slim\Factory\AppFactory;
|
|
|
|
use Slim\Views\Twig;
|
|
|
|
use Slim\Views\TwigMiddleware;
|
|
|
|
|
2021-03-27 04:24:16 +01:00
|
|
|
include "brain/controller/RouteControl.inc.php";
|
2021-03-01 02:04:54 +01:00
|
|
|
|
|
|
|
$app = AppFactory::create();
|
2021-03-25 22:05:32 +01:00
|
|
|
$twig = Twig::create("brain/views/");
|
2021-03-01 02:04:54 +01:00
|
|
|
$app->add(TwigMiddleware::create($app, $twig));
|
|
|
|
|
2021-03-27 04:24:16 +01:00
|
|
|
//set up routing
|
|
|
|
$app->get("/[{first}[/{second}[/{third}]]]", "\RouteControl:get");
|
|
|
|
$app->post("/[{first}[/{second}[/{third}]]]", "\RouteControl:post");
|
|
|
|
//start the app
|
2021-03-25 00:59:28 +01:00
|
|
|
$app->run();
|