From bffbaa9969ca573e3d168eb8309cc4afe323e248 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Tue, 7 Jan 2020 11:25:18 -0800 Subject: [PATCH] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 002f0aa..7b13c71 100644 --- a/README.md +++ b/README.md @@ -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: { @@ -271,7 +271,7 @@ exports.GET = function(req, res) { numPkmn: 151, hometown: 'Pallet Town' } - } + }; } ``` @@ -279,8 +279,8 @@ exports.GET = function(req, res) { /** /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: {