Skip to content

Instantly share code, notes, and snippets.

@balinterdi
Created October 20, 2014 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balinterdi/178cae0a111bedd51e4f to your computer and use it in GitHub Desktop.
Save balinterdi/178cae0a111bedd51e4f to your computer and use it in GitHub Desktop.
Ember-CLI http proxy config
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