File: /var/www/vhosts/creativefellows.nl/kika.creativefellows.nl/src/routes.php
<?php
use Slim\Http\Request;
use Slim\Http\Response;
$app->group('/', function(){
// Homepage
$this->get('','Cassette:loginPage')->setName("homepage");
$this->get('aanmelden','Cassette:subscribePage')->setName("aanmelden");
$this->post('aanmelden','Cassette:postUser')->setName("postuser");
// login user
$this->post('login','Cassette:login')->setName("loginuser");
});
$app->group('/games', function(){
$this->get('','Cassette:gamePage')->setName("gamepage");
$this->get('/geensaldo','Cassette:errorPage')->setName("geensaldo");
$this->post('/set-status','Cassette:setGameStatus')->setName("setstatus");
$this->get('/{id}/new','Cassette:startNewGame')->setName("newgame");
$this->get('/{id}-{game_user_id}','Cassette:viewGame')->setName("viewgame");
$this->post('/{id}','Cassette:placeBet')->setName("placebet");
})->add($authentication);
$app->group('/admin', function(){
$this->get('','Cassette:admin')->setName("admin");
$this->get('/new','Cassette:newGame')->setName("addgame");
$this->get('/users','Cassette:viewUsers')->setName("users");
$this->get('/users/{id}','Cassette:viewUser')->setName("viewuser");
$this->post('/users/{id}','Cassette:patchUser')->setName("patchuser");
$this->post('/new','Cassette:postGame')->setName("postgame");
$this->get('/{id}','Cassette:viewGameDetails')->setName("viewgamedetails");
$this->post('/patch/{id}','Cassette:patchGame')->setName("patchgame");
})->add($authentication);
?>