Skip to content

Instantly share code, notes, and snippets.

@axshia
Created November 23, 2015 01:31
Show Gist options
  • Save axshia/338bd7c185439f27ff68 to your computer and use it in GitHub Desktop.
Save axshia/338bd7c185439f27ff68 to your computer and use it in GitHub Desktop.
GeneratorGulpAngularのローカル開発時のプロキシ設定例
var options = {
target: 'http://dev.webreader.jp', // target host
changeOrigin: true, // needed for virtual hosted sites
ws: false, // proxy websockets
pathRewrite: {
//'^/api': '/new/api' // rewrite paths
},
proxyTable: {
// when request.headers.host == 'dev.localhost:3000',
// override target 'http://www.example.org' to 'http://localhost:8000'
'localhost:3000': 'http://dev.webreader.jp'
}
};
server.middleware = proxyMiddleware('/api', options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment