简体   繁体   中英

Node.js + express how to add string to the request url?

I have a reverse proxy that works great like this:

app.all('/geoserver', function (req, res) {
    apiProxy.web(req, res, {target: serverOne});
});

I need to add to the request url a string like this:

&cql_filer=strSubstring(codigo,0,3)=%27201%27

Before proxying to the serverOne .

Tried with req = req + '&cql_filer=strSubstring(codigo,0,3)=%27201%27'; but it is not working.

Any idea on how to solve this? Thanks!

The proxy module seems to use req.url to determine the url to proxy to. You can change req.url to your needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM