prateeak ojha prateeak ojha - 1 year ago 46
Node.js Question

How to Register Node app with Spring Cloud and Netflix's Eureka

I am trying hard to register my node app, with Netflix's Eureka , and after googling a lot, I am still looking for a solution . The max I can figure out is we have Prana but I got an issue which is still in the issue list of Prana (I guess it means my REST Template is not able to discover this app).

Sidecar , is another suggested solution , for which I am not getting any response . Apart from these two I have found a node module Eureka-Node-client , but none of them serve my purpose .

Answer Source

You can create a Sidecar application like you would create any spring-boot app:

public class SideCarApplication {

    public static void main(final String[] args) {, args);


The important thing is that you have to configure it to correctly register your actual service. Your application.yml should look like this:

  port: 9999 -- the port your spring-boot sidecar is running
    name: nodeapplication -- the name will be your id in eureka

  port: 8000 -- the node applications port
  health-uri: http://localhost:8000/health.json -- the exposed health eindpoint of your node application

It is important to note that the healthpoint should return UP so your services status will be correct in eureka. The returned json for a healthy service :


If you are having trouble setting up a spring-boot app, use to configure a project. Sadly there isn't a sidecar option to tick, but you will get the idea. You can do the same from STS (Spring Tool Suite).

The maven dependency for Sidecar (with spring-cloud as a parent):

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download