Skip to content

Commit

Permalink
log stream
Browse files Browse the repository at this point in the history
  • Loading branch information
cgawron committed Mar 13, 2024
1 parent a4e6760 commit f777b05
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ app.get('/user', (req, res) => {
res.send(req.user);
});

app.use((req, res, next) => {
res.on('data', (chunk) => {
console.log('chunk', chunk.toString());
})
res.on('end', () => {
console.log('end');
})
next()
})

app.use(`${PREFIX}*`,
proxy(API_URL, {
https: true,
Expand All @@ -146,8 +156,6 @@ app.use(`${PREFIX}*`,
console.log('body', srcReq.body);
return proxyReqOpts;
}
}).on('data', (data) => {
console.log('Data:', data);
})
);

Expand Down

0 comments on commit f777b05

Please sign in to comment.