Created
October 20, 2014 14:40
-
-
Save balinterdi/178cae0a111bedd51e4f to your computer and use it in GitHub Desktop.
Ember-CLI http proxy config
This file contains 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
var proxyPath = '/api'; | |
module.exports = function(app) { | |
// For options, see: | |
// https://github.com/nodejitsu/node-http-proxy | |
var proxy = require('http-proxy').createProxyServer({}); | |
var path = require('path'); | |
app.use(proxyPath, function(req, res, next){ | |
// Do not include root path in proxied request | |
// req.url = path.join(proxyPath, req.url); | |
proxy.web(req, res, { target: 'http://api.example.com/' }); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment