2021-02-28 17:04:54 -08:00
|
|
|
<?php
|
2021-03-25 14:05:32 -07:00
|
|
|
require __DIR__ . "/vendor/autoload.php";
|
|
|
|
|
2021-02-28 17:04:54 -08: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-26 20:24:16 -07:00
|
|
|
include "brain/controller/RouteControl.inc.php";
|
2021-03-27 13:59:44 -07:00
|
|
|
include "brain/data/Auth.inc.php";
|
2021-02-28 17:04:54 -08:00
|
|
|
|
|
|
|
$app = AppFactory::create();
|
2021-03-25 14:05:32 -07:00
|
|
|
$twig = Twig::create("brain/views/");
|
2021-02-28 17:04:54 -08:00
|
|
|
$app->add(TwigMiddleware::create($app, $twig));
|
2021-03-27 13:59:44 -07:00
|
|
|
session_start();
|
2021-03-26 20:24:16 -07:00
|
|
|
//set up routing
|
2021-03-27 13:59:44 -07:00
|
|
|
$app->get("/[{first}[/{second}[/{third}[/{fourth}]]]]", "\RouteControl:get");
|
|
|
|
$app->post("/[{first}[/{second}[/{third}[/{fourt}]]]]", "\RouteControl:post");
|
2021-03-26 20:24:16 -07:00
|
|
|
//start the app
|
2021-03-24 16:59:28 -07:00
|
|
|
$app->run();
|