Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ember-cli --proxy works for GET but fails on PUT and POST

I'm trying to move my application from Ember Appkit to ember-cli and I'm having trouble replicating the proxy functionality previously provided by the APIMethod and proxyURL methods.

I'm starting the server to proxy to localhost:3000

ember serve --proxy http://localhost:3000/

This will read my data from the rails server correctly. However, when I try to write to the server, I get an error message

POST http://localhost:4200/api/v1/posts 408 (Request Time-out)

It's trying to post to port 4200, which is where the ember app is being served, but I want it to post to port 3000. How can I get it to do so?

I'm using ember-cli 0.28, ember 1.5.1, ember-data 1.0.0-beta.7, and rails 4.1.

like image 560
Jeffrey Biles Avatar asked May 25 '14 14:05

Jeffrey Biles


1 Answers

The solution was to comment out app.use(bodyParser()); in server/index.js

like image 66
Jeffrey Biles Avatar answered Sep 27 '22 23:09

Jeffrey Biles