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