Exemplo n.º 1
0
    $req = $app->request();
    $bdy = $req->getBody();
    $location = json_decode($bdy);
    $cn = new Locations();
    $cn->insertLocation($locaiton[0]);
});
$app->get('/api/locations/:id', function ($id) {
    $cn = new Locations();
    $cn->getLocationById($id);
});
$app->put('/api/locations/:id', function ($id) use($app) {
    $req = $app->request();
    $bdy = $req->getBody();
    $contact = json_decode($bdy);
    $cn = new Locations();
    $cn->updateLocation($id, $location[0]);
});
$app->delete('/api/locations/:id', function ($id) {
    $cn = new Locations();
    $cn->deleteLocation($id);
});
$app->get('/api/venues/', function () {
    $cn = new Venues();
    $cn->getVenues();
});
$app->post('/api/venues/', function () use($app) {
    $req = $app->request();
    $bdy = $req->getBody();
    $venue = json_decode($bdy);
    $cn = new Venues();
    $cn->insertVenue($venue[0]);