Skip to content Skip to sidebar Skip to footer

Adding Grunt-connect-proxy To Generator-angular Gruntfile.js

I'm trying to add grunt-connect-proxy to my gruntfile.js in a yeoman generator-angular project (generator-angular 0.15.1) but I can't seem to get it to work since the way it's writ

Solution 1:

So I got some help and this is how it was solved:

  livereload: {
    options: {
      open: true,
      middleware: function(connect) {
        var middlewares = [require('grunt-connect-proxy/lib/utils').proxyRequest];
        return middlewares.concat(
          connect.static('.tmp'),
          connect().use('/bower_components', connect.static('./bower_components')),
          connect().use('/app/styles', connect.static('./app/styles')),
          connect.static(appConfig.app)
        );
      }
    }
  }

Hope this helps someone else too.

Post a Comment for "Adding Grunt-connect-proxy To Generator-angular Gruntfile.js"