This is an HTTP proxy which will help with FE development of ATG pages. The main and only feature is to proxy HTTP pages and replace some assets accoring to config rules.
Config file ( config.js ) is pretty staightforward. It's a node module which exports a config object
port
- (optional. default: 8888) - Local proxy server port
target
- (required) - Target webpage url, for example http://latgipo20int.schneider-electric.com
rules
- (optional, kind of...) - Array or file-replacement rules object
ruleObject.original
- (required) = RegExp or string which will be converted to regexp
ruleObject.local
- (required) = Replacement file path. Can include match groups from regex ( i.e. $1 )
see included config.js as an example.
Clone the repo, adjust config and develop:
$ npm install
$ npm run start
Now http://localhost:8888/shop/us/en/tools/replacement-battery-selector will proxy the http://latgipo20int.schneider-electric.com/shop/us/en/tools/replacement-battery-selector with the file replacement rules applied.