Exemplo n.º 1
0
//
// ==============================================================================
use Welfony\Welstory\Controller\API\ActivityController;
use Welfony\Welstory\Controller\API\FollowController;
use Welfony\Welstory\Controller\API\UserController;
$app->get('/users/:userId', function ($userId) use($app) {
    $ctrl = new UserController();
    $ctrl->getUserDetail($userId);
})->conditions(array('userId' => '\\d{1,10}'));
$app->get('/users', function () use($app) {
    $ctrl = new UserController();
    $ctrl->index();
});
$app->post('/users/signup', function () use($app) {
    $ctrl = new UserController();
    $ctrl->signUpWithEmail();
});
$app->post('/users/signin', function () use($app) {
    $ctrl = new UserController();
    $ctrl->signInWithEmail();
});
$app->post('/users/:userId/avatar', function ($userId) use($app) {
    $ctrl = new UserController();
    $ctrl->changeAvatar($userId);
})->conditions(array('userId' => '\\d{1,10}'));
$app->put('/users/:userId', function ($userId) use($app) {
    $ctrl = new UserController();
    $ctrl->updateProfile($userId);
})->conditions(array('userId' => '\\d{1,10}'));
$app->get('/users/:userId/follows/sender/:senderId', function ($userId, $senderId) use($app) {
    $ctrl = new FollowController();