Skip to content

Commit 1fe8716

Browse files
committed
logging
1 parent d9e5f69 commit 1fe8716

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

api/download.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ module.exports = (req, res) => {
2020
})
2121
.then((r) => r.json())
2222
.then((r) => {
23-
const link = r.versions[r['dist-tags'].latest].dist.tarball;
24-
return fetch(link, {
25-
redirect: 'manual',
26-
headers: { authorization },
27-
}).then((r2) => {
28-
res.status(302);
29-
res.setHeader('location', r2.headers.get('location'));
30-
return res.end();
31-
});
23+
console.log(r);
24+
return r.versions[r['dist-tags'].latest].dist.tarball;
25+
})
26+
.then((link) => fetch(link, {
27+
redirect: 'manual',
28+
headers: { authorization },
29+
}))
30+
.then((r) => {
31+
res.status(302);
32+
res.setHeader('location', r.headers.get('location'));
33+
return res.end();
3234
});
3335
};

0 commit comments

Comments
 (0)