私の開発環境では、grunt connect with livereload を使用しています。
/server の下にある本番 API を呼び出せるようにしたいと考えています。
そのためには、次からの呼び出しを転送する必要があります
http://localhost:9000/server
に
http://www.production-server.com/server
これは私にとっては良いことです。なぜなら、開発モードで運用サーバーに対してテストしたい場合があるからです。
これが私の現在の接続構成です(Yeomanによって生成されました):
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: 'localhost',
livereload: 35729
},
livereload: {
options: {
open: true,
middleware: function(connect, options, middlewares) {
return [
connect.static('.tmp'),
connect().use(
'/bower_components',
connect.static('./bower_components')
),
connect.static(appConfig.app)
];
}
}
},
test: {
options: {
port: 9001,
middleware: function(connect) {
return [
connect.static('.tmp'),
connect.static('test'),
connect().use(
'/bower_components',
connect.static('./bower_components')
),
connect.static(appConfig.app)
];
}
}
},
dist: {
options: {
open: true,
base: '<%= yeoman.dist %>'
}
}
},