gulp.task('connect', function() { connect.server({ root: ['.'], livereload: true, port: options.connectPort, middleware: function(conn, opt) { return [ proxy('!/app/**', { target: options.serverUrl, changeOrigin : false, ws: true }) ]; } }); });
app.use('/iot', proxy({target: 'http://192.168.88.111:8080', pathRewrite: {'^/iot' : '/'}, changeOrigin: true, ws: true, logProvider: function(){ return require('debug')('api-gateway:proxyLog')}}))
gulp.task('client:serve', function(cb) { // Proxy Middleware to Express app var proxyServer = proxy('/api', { target: 'http://localhost:3002' }); browserSync.instance = browserSync.init({ startPath: '/', server: { baseDir: ['.tmp/', 'client'], middleware: [proxyServer], routes: { '/bower_components': 'bower_components' } }, //browser: ['google chrome', 'firefox', 'internet explorer'], browser: (os.platform() === 'linux' ? ['google-chrome'] : ['google chrome']) }, cb); });
gulp.task('serve', function () { nodemon({ script:'server.js', ext:'js css' }), connect.server({ root: ['./public', './public/build'], port: '3001', livereload: true, fallback: public+'index.html', middleware: function (connect, opt) { return [ proxy('/api', { target: 'http://localhost:3300', changeOrigin: true }) ] } }); });