Predix_Logo
  • Categories
    • Questions
    • Predix | Updates
      • Pricing
      • Product
    • Deloitte - Private
    • How-To
    • Accenture-Private
  • Explore
    • Topics
    • Questions
    • Articles
    • Feedback or Feature Requests
  • Sign in
  • Home /
  • Questions /
avatar image
0
Question by bin2.luo@ge.com · Oct 24, 2015 at 12:02 AM ·

502 Bad Gateway: Registered endpoint failed to handle the request.

all the app apis work fine on the local machines, but after pushed to cloud foundry all the api return 502 Bad Gateway: Registered endpoint failed to handle the request.

app is built on Node.js use the javascript to call the local json file and Express api, some of the code call json files as below:

function get_json(){ $.ajax({ dataType: "json", url: 'json/export.json', success: parse_json }); }

 $http.get('json/risk_file.json')
     .success(function(data) {
         $scope.webData = data;
         console.log(data);
     })
     .error(function(error) {
         console.log('Error: ' + error);
     });



Comment
Add comment
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
0

Answer by Greg Stroup · Oct 27, 2015 at 05:13 PM

That looks like it should work. A few things to look at:

  1. Make sure the risk_file.json is included in your "dist" build, and deployed to cloud foundry

  2. Try the "json/risk_file.json" URL directly in your browser to make sure it loads.

  3. Try a leading slash to make the path absolute: "/json/risk_file.json"

Comment
Add comment · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

GE Monogram
  • Legal
  • Cookies
  • Forum Terms
  • Contact Us
  • Copyright © 2017 General Electric Company. All rights reserved.


Enterprise
Social Q&A

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Submit your feedback or feature request
  • Categories
  • Questions
  • Predix | Updates
    • Pricing
    • Product
  • Deloitte - Private
  • How-To
  • Accenture-Private
  • Explore
  • Topics
  • Questions
  • Articles
  • Feedback or Feature Requests