require 'lib/RRRest.php'; // ------------------------------------------------------- App Bootloader Below $rrApp = new RRApplication(); $appRoute = new \Slim\Slim(); $appRoute->get('/', function () use($rrApp) { // Generate Roll - Homepage $rrApp->showMain(); }); $appRoute->get('/roll/:rollid', function ($rollid) use($rrApp) { // Get Roll $rrApp->showRoll($rollid); }); $appRoute->get('/roll/:rollid/:serialdice', function ($rollid, $serialdice) use($rrApp) { // Get Roll $rrApp->executeRoll($rollid, $serialdice); $rrApp->showExecuteRoll($rollid); }); $appRoute->get('/generate', function () use($rrApp) { // Generate Roll - selection screen $rrApp->showGenerateMain(); }); $appRoute->get('/generate/:dd', function ($dd) use($rrApp) { // Generate Roll - with difficulty dice $rrApp->showRollURL($rrApp->generateRoll($dd)); }); // REST API ---------------------------------------------- $api = new RRRest($rrApp); $appRoute->get('/rest/getroll/:rollid', function ($rollid) use($api) { $api->getRoll($rollid); }); $appRoute->get('/rest/roll/:rollid', function ($rollid) use($api) {