Add a service to etcd-registry and remove it when your service process exits
npm install etcd-registry-join
Or if you want to install the command line tool as well
npm install -g etcd-registry-join
var join = ;var http = ;var server = http;server;
You should replace
http://127.0.0.1 with your connection string to etcd.
Alternatively you can pass an instance of etcd-registry.
When the process receives
SIGINT it will unregister the service from the registry
before exiting the process.
You can also use the command line tool
etcd-registry-join my-service my-app.js
Where my app looks like
var http = ;var server = http;server; // this env var is set by etcd-registry-join
When your server is listening on
PORT etcd-registry-join will add your service to the registry