|
|
@ -24,24 +24,24 @@ include "../brain/utility/HandleCors.inc.php";
|
|
|
|
|
|
|
|
|
|
|
|
class App
|
|
|
|
class App
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public function __construct()
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// set up cors
|
|
|
|
// set up cors
|
|
|
|
new HandleCors();
|
|
|
|
new HandleCors();
|
|
|
|
$app = AppFactory::create();
|
|
|
|
$app = AppFactory::create();
|
|
|
|
$twig = Twig::create("../brain/views/");
|
|
|
|
$twig = Twig::create("../brain/views/");
|
|
|
|
$app->add(TwigMiddleware::create($app, $twig));
|
|
|
|
$app->add(TwigMiddleware::create($app, $twig));
|
|
|
|
//set up routing
|
|
|
|
//set up routing
|
|
|
|
$app->get(
|
|
|
|
$app->get(
|
|
|
|
"/[{first}[/{second}[/{third}[/{fourth}[/{fifth}]]]]]",
|
|
|
|
"/[{first}[/{second}[/{third}[/{fourth}[/{fifth}]]]]]",
|
|
|
|
"\RouteControl:get"
|
|
|
|
"\RouteControl:get"
|
|
|
|
);
|
|
|
|
);
|
|
|
|
$app->post(
|
|
|
|
$app->post(
|
|
|
|
"/[{first}[/{second}[/{third}[/{fourth}]]]]",
|
|
|
|
"/[{first}[/{second}[/{third}[/{fourth}]]]]",
|
|
|
|
"\RouteControl:post"
|
|
|
|
"\RouteControl:post"
|
|
|
|
);
|
|
|
|
);
|
|
|
|
//start the app
|
|
|
|
//start the app
|
|
|
|
|
|
|
|
|
|
|
|
$app->run();
|
|
|
|
$app->run();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|