tag:blogger.com,1999:blog-8923925623275189276.post5926433361755110259..comments2022-11-14T17:57:45.950-06:00Comments on No problem: Grunt Proxy Setup for YeomanMike Partridgehttp://www.blogger.com/profile/02371913846748109417noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-8923925623275189276.post-5724119167572064772016-01-15T12:06:25.898-06:002016-01-15T12:06:25.898-06:00I follow the instructions above, very similar is m...I follow the instructions above, very similar is my configuration but when I do the "grunt serve" doesn't show that the proxy is created and the server start well. The proxy configurations do a rewrite of the port, nothing else but the proxy is never created. I wonder is have a bad configuration or something is missing.<br /><br />Installation detail:<br />npm --version -> 1.4.28<br />grunt --version -> v0.4.5<br />grunt-connect-proxy@0.2.0Fernandohttps://www.blogger.com/profile/09184551365345680483noreply@blogger.comtag:blogger.com,1999:blog-8923925623275189276.post-7725365499864488002015-07-31T12:18:12.586-05:002015-07-31T12:18:12.586-05:00THANK YOU SO MUCH!!!!!!!!!!!!!THANK YOU SO MUCH!!!!!!!!!!!!!Chichohttps://www.blogger.com/profile/03385410891365355496noreply@blogger.comtag:blogger.com,1999:blog-8923925623275189276.post-17221914104043554162015-06-12T13:51:29.300-05:002015-06-12T13:51:29.300-05:00This was a great post, thanks!This was a great post, thanks!Anonymoushttps://www.blogger.com/profile/12607722937999112868noreply@blogger.comtag:blogger.com,1999:blog-8923925623275189276.post-38869714113578242452015-06-12T13:51:11.482-05:002015-06-12T13:51:11.482-05:00This was a great and helpful post, thanks!This was a great and helpful post, thanks!Anonymoushttps://www.blogger.com/profile/12607722937999112868noreply@blogger.comtag:blogger.com,1999:blog-8923925623275189276.post-12417633094264203652015-03-18T05:41:25.978-05:002015-03-18T05:41:25.978-05:00Thank you, this set me on the right path!
With c...Thank you, this set me on the right path! <br /><br />With current versions of things (I guess this is due to updates on generator-angular, which for me is 0.11.1), step #3 gets slightly simpler since the middleware function already returns an array, you just have to add<br /><br /> require('grunt-connect-proxy/lib/utils').proxyRequest,<br /><br />right after the lines "middleware: function (connect) { return [ ".<br /><br />I also discovered what I think is a simpler way of doing what you do above, since <a href="" rel="nofollow">this commit</a> (version 0.7.1 of grunt-contrib-connect) you get the existing middlewares as a third parameter so you can just inject the proxy requester as the first element of the arrary - I haven't tested, but I think something like this should work:<br /><br />https://gist.github.com/skagedal/9c4bcee9968e7242788dSimonhttps://www.blogger.com/profile/11297030098914336180noreply@blogger.comtag:blogger.com,1999:blog-8923925623275189276.post-9247893587108036522014-10-26T22:02:48.903-05:002014-10-26T22:02:48.903-05:00Thank you for this! Great details on what to put w...Thank you for this! Great details on what to put where... finally got everything working on my end. CheersAnonymoushttps://www.blogger.com/profile/08490440651295103193noreply@blogger.comtag:blogger.com,1999:blog-8923925623275189276.post-60394741672537662982014-05-14T21:04:01.050-05:002014-05-14T21:04:01.050-05:00@John - your proxies config is inside connect.serv...@John - your proxies config is inside connect.server, but in my Gruntfile it's a child of connect, at the same level as livereload. <br />The post incorrectly states that proxies should be added to connect.server, but I'll fix that shortly.Mike Partridgehttps://www.blogger.com/profile/02371913846748109417noreply@blogger.comtag:blogger.com,1999:blog-8923925623275189276.post-32979696744088300552014-05-14T13:09:23.692-05:002014-05-14T13:09:23.692-05:00After following the walkthrough I do have grunt te...After following the walkthrough I do have grunt telling me that the proxy is working. Upon running grunt serve I see the message:<br /><br />Running "configureProxies:server" (configureProxies) task<br />Proxy created for: /api to localhost:8080<br /><br />However when I try to make a call using either $http or $resource I can see through the network and console that the call is still going to localhost:9000 which is where my node server is running the angular app. This is a gist of my gruntfile. Any input would be much appreciated.<br /><br />https://gist.github.com/JohnBueno/7d48027f739cc91e0b79Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8923925623275189276.post-118043351562237842014-01-18T06:29:55.403-06:002014-01-18T06:29:55.403-06:00Thanks for the helpful configuration walkthrough. ...Thanks for the helpful configuration walkthrough. After trying to read through the official docs for grunt-connect-proxy, your post was what finally made it all make sense. :)jonchasehttps://www.blogger.com/profile/08695805954556616352noreply@blogger.com