drewzboto / grunt-connect-proxy

Grunt Connect support for proxying API calls during development
MIT License
423 stars 122 forks source link

Trying to make grunt-connect-proxy work under $http.post() with Play 2.4.6 backend #127

Open renexdev opened 8 years ago

renexdev commented 8 years ago

Hi guys, I'm having some issues on trying to make grunt-connect-proxy works under a $http.post() call. The problem is that when I checked the opened link generated by a $http.post(), grunt serve doesn't redirect to my back-end app but to the already yeoman serving app. I tried also put a devil "/" in the "context" key to check if I get some response, and the app cannot resolve the route, so I suppose that some features of grunt-connect-proxy are working. But I cannot figure out what is going on, the context setted as "/api" is not being proxied with a $http.post('api/signup', payload) call.

I upload the app at https://github.com/renexdev/grunt-connect-proxy-test if you wanna do a quick code check. The important files would be Gruntfile.js and app/scripts/controllers/signup.js files.

Thanks for any help!! Cheers

P.S in case that the module grunt-connect-proxy wouldn't be compatible with $http.post() calls... is there any other module that you can suggest me?

ronakkaria commented 8 years ago

@renexdev I used your code to connect my own server on localhost and it seems to be working. What is your backend app like?

renexdev commented 8 years ago

Hi @renexdev, I was trying to use Play framework 2.4... Thanks for your reply. Cheers

renexdev commented 8 years ago

@ronakkaria I moved to a plug-in for play called "sbt-yeoman" (https://github.com/tuplejump/play-yeoman) and now I can see routes with angular. Anyway if you have any suggestion on how making grunt-connect-proxy working with play, please let me know. Thanks for your time. Cheers, ReneX