You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an AngularJS app backed by a Rails api app (3.2). I'm trying to add a mobile web interface to my AngularJS app and am having trouble communicating with my Rails api backend when using a mobile user-agent (NOTE: when the user-agent is for a 'normal' desktop - everything works great). Some additional details may help ...
The way my app is setup (in development) is that the AngularJS app is served on port 9000 and the Rails api backend is served on port 3000. So I launch my Angular app at http://localhost:9000. The Rails api is accessible at http://localhost:3000/api.
Let's say I have a motd (message of the day) endpoint that my Angular app calls. This works today. I can launch the AngularJS app at http://localhost:9000 and see my app's homepage. When using the default user-agent I can directly access the motd data at http://localhost:3000/api/motd and get a normal response.
However - when I switch my user-agent to be one corresponding to an iOS device - I get a HTTP/1.1 406 Not Acceptable' error. I'm using Rack-Cors and its configured as follows (in config/application.rb) ...
config.middleware.use Rack::Cors do
allow do
origins '*'
resource '*', :headers => :any, :methods => [:get, :post, :options]
end
end
Any help would be immensely appreciated.
Thanks
Dave
The text was updated successfully, but these errors were encountered:
Hi All
I have an AngularJS app backed by a Rails api app (3.2). I'm trying to add a mobile web interface to my AngularJS app and am having trouble communicating with my Rails api backend when using a mobile user-agent (NOTE: when the user-agent is for a 'normal' desktop - everything works great). Some additional details may help ...
The way my app is setup (in development) is that the AngularJS app is served on port 9000 and the Rails api backend is served on port 3000. So I launch my Angular app at http://localhost:9000. The Rails api is accessible at http://localhost:3000/api.
Let's say I have a motd (message of the day) endpoint that my Angular app calls. This works today. I can launch the AngularJS app at http://localhost:9000 and see my app's homepage. When using the default user-agent I can directly access the motd data at http://localhost:3000/api/motd and get a normal response.
However - when I switch my user-agent to be one corresponding to an iOS device - I get a HTTP/1.1 406 Not Acceptable' error. I'm using Rack-Cors and its configured as follows (in config/application.rb) ...
Any help would be immensely appreciated.
Thanks
Dave
The text was updated successfully, but these errors were encountered: