如何让EmberCLI代理POW服务器?我使用ember-cli master和新的显式代理(https://github.com/stefanpenner/ember-cli/pull/1530)。例如,这不起作用:
var Proxy = require('http-proxy');
// For options, see:
// https://github.com/nodejitsu/node-http-proxy
var proxy = Proxy.createProxyServer({});
module.exports = function(app) {
app.use('/', function(req, res, next){
proxy.web(req, res, { target: 'http://api.mywebsite.dev' });
})
};
但是,如果我将目标更改为localhost,一切正常:
var Proxy = require('http-proxy');
// For options, see:
// https://github.com/nodejitsu/node-http-proxy
var proxy = Proxy.createProxyServer({});
module.exports = function(app) {
app.use('/', function(req, res, next){
proxy.web(req, res, { target: 'http://localhost:9292' });
})
};