Created by: Matwolf08
Using node-http-proxy I ran into need of perform URL rewriting only for some of the routes specified into routes table. I have implemented the possibility of specify multiple parameters for every route of the routes table and configured a new "rewriteURL" parameter that permits to conditionally check if the URL rewriting must be performed or not for the matched entry of the routes table.
In this way, the routes must be specified as follows:
router: { 'www.example.com/route1': { target:'127.0.0.1:8000' }, //For the following entry I need to perform rewriting: 'www.example.com/route2': { target:'127.0.0.1:8001', rewriteURL:true}, 'www.example.com': { target:'127.0.0.1:3000' } }
For my needs, this feature is very useful! I hope that will be useful for others too!