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());
});