502 Bad Gateway while using apimocker on HostedTarget

I am getting the 502 error on using the HostedTarget with apimocker. The node application works fine locally where as it gives bad gateway error on apigee with no errors on the RuntimeLogs.

please note that i have migrated from NodeJs API to HostedTarget API, and changed the the target endpoint from <ScriptTarget> to <HostedTarget> and changed the folder under resources from node to hosted.

<html>
<head> <title>502 Bad Gateway</title> </head>
<body bgcolor="white"> <center> <h1>502 Bad Gateway</h1> </center> <hr> <center>nginx/1.11.13</center> </body>

</html>

Solved Solved
1 2 401
1 ACCEPTED SOLUTION

[SOLVED]

while using the apimocker you specify the port you're listening to on the config.json file.

just make sure you're listening to the right port.

use console.log(process.env.PORT); to know which port you should listen to

View solution in original post

2 REPLIES 2

[SOLVED]

while using the apimocker you specify the port you're listening to on the config.json file.

just make sure you're listening to the right port.

use console.log(process.env.PORT); to know which port you should listen to

Thanks for sharing your solution Samer!!! 🙂