Hi!,

I am new to NODE JS + GAE so pls forgive newbie question.

I want my app to serve up a REST call that will consolidate the results of 
calls to other externally hosted API's (third parties - none GAE)

I have this javascript working from my PC but when I deploy to GAE i get 
"502 Bad Gateway" errors. I can't find anything in the logs to help explain 
this error. Note my REST call is working (ie GAE is receiving the call) but 
is failing to make the outbound call to external web site.

Note here is sample NODE JS code that is failing:



'use strict';

 

const express = require('express');

var http = require('http');

var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;

 

const app = express();

 


// [START hello_world]



 

app.get('/test', (req, res) => {

const Http = new XMLHttpRequest();

const url='https://www.google.com';

Http.open("GET", url);

Http.send();

Http.onreadystatechange=(e)=>{

console.log(Http.responseText)

}});

 

// [END hello_world]

 

if (module === require.main) {

  // [START server]

  // Start the server

  const server = app.listen(process.env.PORT || 8080, () => {

    const port = server.address().port;

    console.log(`App listening on port ${port}`);

  });

  // [END server]

}

 

module.exports = app;

 

 

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/7e88a339-6783-47df-a20a-641e51dd8578%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [google-appengine]... mags Sweet

Reply via email to