79230001

Date: 2024-11-27 11:12:05
Score: 0.5
Natty:
Report link

Since the previous answer using URL.format() is deprecated, here's a simple way to achieve the same thing:

app.get('/old-endpoint', function (req, res) {
    const requestData = new URLSearchParams(req.query);
    res.redirect('/new-endpoint?'+requestData.toString());
});
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: 3snoW