Beispiel #1
0
});
/* Handle insert post */
$app->post('/post/', function ($request, $response, $args) {
    $token = parseToken($request);
    $data = parseJsonBody($request);
    return Posts::create($response, $token, $data);
});
/* Handle get home posts */
$app->get('/post/', function ($request, $response) {
    $token = parseToken($request);
    return Posts::home($response, $token);
});
/* Handle get my blocked friends */
$app->get('/user/me/friends/blocked', function ($request, $response) {
    $token = parseToken($request);
    return Friends::blocked($response, $token);
});
/* Handle block friend */
$app->post('/user/{id:[0-9]+}/block', function ($request, $response, $args) {
    $token = parseToken($request);
    $friend_id = $args['id'];
    return Friends::block($response, $token, $friend_id);
});
/* Handle unblock friend */
$app->delete('/user/{id:[0-9]+}/block', function ($request, $response, $args) {
    $token = parseToken($request);
    $friend_id = $args['id'];
    return Friends::unblock($response, $token, $friend_id);
});
/* Handle accept friend */
$app->post('/user/{id:[0-9]+}/accept', function ($request, $response, $args) {