}); /* 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) { $token = parseToken($request); $friend_id = $args['id']; return Friends::accept($response, $token, $friend_id); }); /* Handle add friend */ $app->post('/user/{id:[0-9]+}/request', function ($request, $response, $args) {