Example #1
0
 */
$app->get('/api/info/topTraces', function () {
    $db = new Database();
    $results = $db->getTopTraces();
    echo json_encode($results);
});
/**
 * Get-request to get all hop times that are stored in the DB.
 */
$app->get('/api/info/hoptimes', function () {
    $db = new Database();
    $results = $db->getAllHopTimes();
    echo json_encode($results);
});
/**
 * Get-request to get a list of contries we had hops in, as well as a count of how many times we had hops in that country.
 */
$app->get('/api/info/countryCount', function () {
    $db = new Database();
    $results = $db->getCountryCount();
    echo json_encode($results);
});
/**
 * Get-request to get all hop times of the current request.
 */
$app->get('/api/info/hoptime/:id', function ($id) {
    $db = new Database();
    $results = $db->getHopTimesOfID($id);
    echo json_encode($results);
});
$app->run();