Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Fix shadowed variable in server example
Browse files Browse the repository at this point in the history
  • Loading branch information
forivall committed Sep 20, 2016
1 parent ddb77b9 commit 8d5399a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.asyncawait.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ http.createServer(async function (req, res) {
// use normal exception handling
try {
// promise-returning async HTTP GET
var res = await request({url: url, headers: headers});
var items = JSON.parse(res.body).items;
var resp = await request({url: url, headers: headers});
var items = JSON.parse(resp.body).items;
// can do nested parallel work by constructing promises in
// parallel then awaiting them, e.g. with Promise.all
var newItems = await Promise.all(items.map(async function (item) {
Expand Down

0 comments on commit 8d5399a

Please sign in to comment.