Esempio n. 1
0
function routeRequest()
{
    $req = new RESTRequest();
    $req->setUrl($_SERVER['REQUEST_URI']);
    $req->setMethod($_SERVER['REQUEST_METHOD']);
    if (preg_match('%\\/cmb-xr-crawler\\/api\\/records%', $req->getUrl())) {
        (new RecordsController($req))->process();
    } else {
        if (preg_match('%\\/cmb-xr-crawler\\/api\\/currency%', $req->getUrl())) {
            (new CurrencyController($req))->process();
        } else {
            RESTUtil::sendResponse(404);
        }
    }
}