Created
October 17, 2012 22:07
-
-
Save robdodson/3908630 to your computer and use it in GitHub Desktop.
proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| httpProxy.createServer(function(req,res,proxy) { | |
| if (req.url.match(/\/data/)) { | |
| console.log('data'); | |
| proxy.proxyRequest(req, res, { | |
| host: config.DATA_APP_HOST, | |
| port: config.DATA_APP_PORT | |
| }); | |
| } else if (req.url.match(/\/wordpress/)) { | |
| console.log('wordpress'); | |
| proxy.proxyRequest(req, res, { | |
| host: config.WORDPRESS_HOST, | |
| port: config.WORDPRESS_PORT, | |
| }); | |
| } else { | |
| console.log('web'); | |
| proxy.proxyRequest(req, res, { | |
| host: config.WEB_APP_HOST, | |
| port: config.WEB_APP_PORT | |
| }); | |
| } | |
| }).listen(config.PROXY_PORT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment