$API_BASE_PATH = '/api/ac-csv-import'; // Remember to update .htacces as well. Same with a '/' at the end... // Result or error responses require_once $BASE . '/lib/response.class.php'; // Checks CORS and pulls Dataporten info from headers require_once $BASE . '/lib/dataporten.class.php'; $dataporten_config = json_decode(file_get_contents($DATAPORTEN_CONFIG_PATH), true); $dataporten = new Dataporten($dataporten_config); // http://altorouter.com require_once $BASE . '/lib/router.class.php'; $router = new Router(); $router->setBasePath($API_BASE_PATH); // Proxy API to Adobe Connect require_once $BASE . '/lib/adobeconnect.class.php'; $adobe_config = json_decode(file_get_contents($ADOBE_CONNECT_CONFIG_PATH), true); $connect = new AdobeConnect($adobe_config); // ---------------------- DEFINE ROUTES ---------------------- /** * GET all REST routes */ $router->map('GET', '/', function () { global $router; Response::result(array('status' => true, 'routes' => $router->getRoutes())); }, 'Routes listing'); /** * GET Adobe Connect version */ $router->map('GET', '/version/', function () { global $connect; Response::result($connect->getConnectVersion()); }, 'Adobe Connect version');
$BASE = dirname(__FILE__); // Result or error responses require_once $BASE . '/lib/response.class.php'; // Checks CORS and pulls Dataporten info from headers require_once $BASE . '/lib/dataporten.class.php'; $dataporten_config = json_decode(file_get_contents($DATAPORTEN_CONFIG_PATH), true); $feide = new Dataporten($dataporten_config); // http://altorouter.com require_once $BASE . '/lib/router.class.php'; $router = new Router(); // $router->addMatchTypes(array('userlist' => '[0-9A-Za-z\[\]@.,%]++')); $router->setBasePath($API_BASE_PATH); // Proxy API to Adobe Connect require_once $BASE . '/lib/adobeconnect.class.php'; $adobe_config = json_decode(file_get_contents($ADOBE_CONNECT_CONFIG_PATH), true); $connect = new AdobeConnect($adobe_config); // ---------------------- DEFINE ROUTES ---------------------- /** * GET all REST routes */ $router->map('GET', '/', function () { global $router; Response::result($router->getRoutes()); }, 'Routes listing'); /** * GET Adobe Connect version */ $router->map('GET', '/version/', function () { global $connect; Response::result($connect->getConnectVersion()); }, 'Adobe Connect version');