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-27 21:59:44 +01:00
|
|
|
include "brain/data/Auth.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 21:59:44 +01:00
|
|
|
session_start();
|
2021-03-27 04:24:16 +01:00
|
|
|
//set up routing
|
2021-03-27 21:59:44 +01:00
|
|
|
$app->get("/[{first}[/{second}[/{third}[/{fourth}]]]]", "\RouteControl:get");
|
|
|
|
$app->post("/[{first}[/{second}[/{third}[/{fourt}]]]]", "\RouteControl:post");
|
2021-03-27 04:24:16 +01:00
|
|
|
//start the app
|
2021-03-25 00:59:28 +01:00
|
|
|
$app->run();
|