Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
amiller-gh authored Jan 7, 2020
1 parent 21e9f34 commit bffbaa9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ This ability to easily compose internal APIs on the server allows us to do some
/** /api/profile/:uid.js **/
// This endpoint returns an entire profile object. So much info!
exports.GET = function(req, res) {
export function GET(req, res) {
return {
status: 'success',
data: {
Expand All @@ -271,16 +271,16 @@ exports.GET = function(req, res) {
numPkmn: 151,
hometown: 'Pallet Town'
}
}
};
}
```
``` JavaScript
/** /api/miniprofile/:uid.js **/
// This mini-profile API endpoint will only return the `firstName` and `lastName` properties of the full profile.
exports.GET = function(req, res) {
const result = res.locals.api.get('/user/' + req.params.uid);
export function GET(req, res) {
const result = await res.locals.api.get(`/profile/${req.params.uid}`);
return {
status: 'success',
data: {
Expand Down

0 comments on commit bffbaa9

Please sign in to comment.