app.get('/mypath', function (req, res) {
var url_parts = url.parse(req.url, true);
var query = url_parts.query;
var param1Value = param1Value;
var param2Value = param2Value;
console.log(req.query)
res.redirect("/mypath/js/index.js?param1="+param1Value+"¶m2="+param2Value+"")
});
As seen above, I can successfully redirect the URL along with the query string.
However, the flow over here is a little different.
There is a web page hosted on https://www.somewebpage.com
where I'm including a JavaScript in the following way.
<script type="text/javascript" async="" src="https://abcd/myscript.js"></script>
myscript.js
is located on another server where I call it using res.redirect
My problem is that I want to receive the query string params in myscript.js
file.
How do I do that?