Ember cli .39 not proxying API requests - ember-cli

Duplicate: Requests proxying stop working after update to ember-cli 0.39
This is known, fix is here and currently in master.
I just upgraded to ember-cli 0.39, and it seems my API requests aren't being proxied to my (rails) backend. This was working in 0.37.
I run the following commands from the respective directories
rails s -p 3900
ember s --port=4900 --proxy=http://0.0.0.0:3900
The ember app serves pages that don't hit my API, but when my routes try to fetch a model (I'm using ember-data), the API response is just my ember app's index.html. I've set some breakpoints in my rails code, and they're not getting triggered, so I know the API requests aren't being proxied appropriately.
Interestingly, I have a login route I use, and that does seem to proxy back to the rails app. But, whenever I use store.find('someModel'), the response is the ember app'sindex.html` and the app chokes.
As part of upgrading to .39 I changed some of my libs over to the ember-cli-addons:
ember-cli-ember-data
ember-cli-ember-simple-auth
I'm not sure if that has anything to do with it. Seems like it could be an ember-data thing.

This is known, fix is here and currently in master.

Related

How to disable HTTP requests on Heroku and/or auto-redirect to HTTPS?

I'm currently deploying a Scala Play 2.7.x application to Heroku intending only HTTPS access but the HTTP access is still available and then in this case, the authentication doesn't work.
How can I disable HTTP completely for a Scala Play application deployed in Heroku?
Heroku doesn't handle redirection for you:
Redirects need to be performed at the application level as the Heroku router does not provide this functionality. You should code the redirect logic into your application.
It looks like this is relatively straightforward with Play Framework version 2.6 or later:
play.filters.enabled += play.filters.https.RedirectHttpsFilter
If necessary, you can override this setting in your development environment by passing -Dplay.filters.enabled=<whatever> locally, or provide an alternate configuration file with -Dconfig.file.

Unable to integrate CQ5.6.1 with Site Catalyst

I'm having difficulty in integrating AEM 5.6.1 with Site Catalyst. It allows me to connect in the configuration successfully, but does not work on the framework setup.
I've followed the standard procedure to connect AEM to SC and it accepts my login in the configuration, but fails on the framework set up with the browser message 'We were not able to login to SiteCatalyst. Please check your credentials and try again.'. Behind the scenes in the server log;
12.12.2014 14:10:06.967 *WARN* [0:0:0:0:0:0:0:1 [1418393406764] POST /libs/cq/analytics/sitecatalyst/service.json HTTP/1.1] com.day.cq.analytics.sitecatalyst.impl.SitecatalystHttpClientImpl Data center 'https://api3.omniture.com/admin/1.3/rest/' responded with errors {"error":{"code":500,"message":"Internal Server Error"}}
12.12.2014 14:10:06.967 *ERROR* [0:0:0:0:0:0:0:1 [1418393406764] POST /libs/cq/analytics/sitecatalyst/service.json HTTP/1.1] com.day.cq.analytics.sitecatalyst.impl.servlets.SitecatalystServlet Call to SiteCatalyst method 'Company.GetReportSuites' failed com.day.cq.analytics.sitecatalyst.SitecatalystException: not authenticated
I've tried accessing via the API Explorer and it works.
I've tried the troubleshooting guide without success.
I can log in to Site Catalyst, I'm an admin, I am in the web services access group.
I've tried using a clean install of CQ5.6.1 with geometrixx - it doesn't work either.
I've tried this from a server and from a localhost/dev machine with the same results. No proxy. I've even tried using the shared secret as the password but then it doesn't connect at all, and fails on the configuration screen.
What might cause this to fail?
If it doesn't work with a fresh install and Geometrixx, then it's probably an Adobe bug. That's typically the first thing support will ask you about.
I would also verify using Geometrixx Outdoors, or a more recent demo site, on your fresh install, just to ensure it's not an outdated ClientLib issue.
I know this isn't a direct answer to your question, but honestly, I would approach the integration differently. I've worked with the AEM-SC framework and it's buggy at best. It's very finicky, it doesn't REALLY work the way the documentation claims, and it requires that you're very specific about what Clientlibs are on the page.
Moving forward, I think using Adobe Dynamic Tag Manager is the better approach, for many reasons. My understanding is that it's Adobe's recommendation as well. I'd consider moving to that. In AEM 5.6.1, you'll have to customize your integration with DTM, but it's not very hard.
Solution: Add a property on the configuration node for sitecatalyst: (eg. /etc/cloudservices/sitecatalyst/my-sc-configuration)
server=https://api.omniture.com/admin/1.2/rest/
it also seems to work with newer API versions such as https://api3.omniture.com/admin/1.3/rest/
It would appear that for 5.6.1 it ignores the OSGi configuration, at least for the configuration screens. With this extra property, the framework page loads without error and allows selection of the RSID.

How to configure the base url of a Catalyst application?

I have developed a Catalyst application, which runs via the catalyst development server at, say, localhost:3000. Next I configured Apache to proxy requests to http://myhost/myapp/ to localhost:3000 using mod_proxy.
I would now like Catalyst to know that it has been publicly relocated to the base url myapp/ and take it into account when forming URLs via uri_for.
How can I do it?
KT, the easiest thing to do is to install Catalyst::TraitFor::Request::ProxyBase, as it is specifically designed to replace request base with the value passed by HTTP proxy.
The module is completely transparent and requires no modification of the existing app.

How to structure a flask restful api with an angularjs client-side app?

How can I get both the flask api and the angular app running on the same web-server? Right now I am stuck running the flask-api on one server and the angular app on a separate node web-server (using the angular seed project). This seems less than ideal.
Im currently in the development stages but I am using similar stack. You are right flask needs to be used on a different port, but simply just wrap your api responses around with "(" ")". So that on the angular.js you can accept JSONP and use the flask api responses.

Very simple rest webservice on ruby on rails

I am trying to implement very-very simple webservice to practice with my iphone application, for example storing geolocation data and retrieving it from web. I started with Ruby on Rails, read some books and install it on my pc.
I install Ruby installer for Windows, then
gem update --system
gem source -a http://gemcutter.org
gem install rails
*then I install sqlite3*
gem install sqlite3-ruby
*and I even install webservice gem*
All working fine and I wrote some simple applications and can access it all on http://localhost:3000. Then I saw this video - http://www.youtube.com/watch?v=J6r_l3cAS9s in which you can see simple restful webservice. As I understand there are no any additional configuration to apps to be a simple webservice. I did exactly what show in this movie and install Fiddler and another rest test client to test this service. I cant get any xml from my app. Fiddler get me my html from http://localhost:3000/words and this rest client http://code.google.com/p/rest-client/ get my again my html page with content type text/html. How can I get XML to start working with this app as webservice?
I use Rails 3
yes, ruby on rails has RESTful service by default. My error was trying to access url http://localhost:3000/words in rest client. If I connect to http://localhost:3000/words.xml instead I immediately get access to my app via XML.
It shouldn't be difficult to get xml response. You might want to peak into TodoAPI and the client for this app as TodoAPIClient. The client uses HTTParty. You may get the response using Curl for terminal.