Search code examples
javascriptnode.jsexpressibm-cloud

2 http servers for 2 services crashing in Node.js Bluemix app


I'm trying to start 2 http servers with express in Node.js to listen to the requests of 2 Bluemix service. Both are working separately but not together. During deploying the app is being started several times without success. The meaningful part of the log is shown on the image attached.

Thanks for any advise, help!

<script src="//pastebin.com/embed_js/YghQ7eFC"></script>

Image about the log


Solution

  • To integrate the previous responses which explain correctly what is happening (two servers binding on the same port), I have to add that even though locally you can have two instances binding on two different custom ports, on Bluemix you cannot have 2 instances running on the same runtime, or even a single instance listening on different ports, because the traffic is routed only on http port 80 (and https 443) To do this: - have a container running this two node instances - have two runtimes