Skip to content

Commit

Permalink
Add version number
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Falzoi <[email protected]>
  • Loading branch information
pippolo84 committed Aug 6, 2024
1 parent 828b23b commit 1d14654
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ module.exports = (req, res, next) => {
}

if (req.path.indexOf("/client-ip") === 0) {
if (req.method == 'POST') {
const data = JSON.parse(JSON.stringify(req.body));
res.json({ "client-ip": req.connection.remoteAddress, "version": data['version'] });
}
res.json({ "client-ip": req.connection.remoteAddress });
}

Expand Down

0 comments on commit 1d14654

Please sign in to comment.