}); /** * Get user's avatar * method GET * url - /avatars/:user_id * return - url of user's avatar image */ $app->get('/avatars/:user_id', 'authenticate', function ($id) use($app) { $response = array(); try { $db = new DbHandler(); if ($id == 0) { global $user_id; $id = $user_id; } $result = $db->getUserAvatar($id); $result['full'] = URL_HOME . path_fulls . $result['full']; $result['avatar'] = URL_HOME . path_avatars . $result['avatar']; $result['icon'] = URL_HOME . path_icons . $result['icon']; $response['avatars'] = $result; $response['error'] = false; $response['success'] = 1; } catch (Exception $e) { $response['error'] = true; $response['message'] = $e->getMessage(); $response['success'] = 0; } echoRespnse(200, $response); }); //-----------------Chat Group------------------------------- /**