diff --git a/server/app.js b/server/app.js index bbeb10a..3b02c4f 100644 --- a/server/app.js +++ b/server/app.js @@ -70,20 +70,10 @@ app.get("/api/users/:username", async (req, res, next) => { userNamePlayDetailsPromise ] - const allSettled = promises => - Promise.all(promises.map(promise => promise - .then(value => ({ state: 'fulfilled', value })) - .catch(reason => ({ state: 'rejected', reason })) - )); - const variableArray = [ "allUsers", "userFriendsDetails", "allUsersPlayInfo", "userNamePlayDetails" ] - Promise.allSettled(promises). - then((results) => console.log(results?.value)); - - // generate header const lazyBody = () => ({ username: username, @@ -93,6 +83,11 @@ app.get("/api/users/:username", async (req, res, next) => { uri: URIFactory(username) }) + + Promise.allSettled(promises). + then((results) => console.log(results?.value)); + + res.status(200).json(lazyBody()); });