-
-
Save dandean/4d29006129aef4fb1797 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HTTP client to communicate with the user service: | |
var userServiceClient = client = restify.createJsonClient({ | |
url: Service.config.userServiceUrl, | |
version: '*' | |
}); | |
/** | |
* GET /user | |
* Gets the currently authenticated user | |
**/ | |
server.get('/user', function(req, res, next) { | |
userServiceClient.get('/users/' + req.uid, function(error, clientReq, clientRes, result) { | |
if (error) return next(error); | |
res.send(clientRes.statusCode, result); | |
return next(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment