Get Service

Introduction


The Composer provides a pointer to the service it deploys.

You can acquire the reference by calling function getService and pass the service name to it as a parameter.


Usage


Get Daemon Example
//assuming that the service name is "myService" and provided in config.js


//deploy the service
composer.deploy(__dirname + "/.config.js", function (error) {
	
	//call get service and acquire a reference to the service deployed.
   	var service = composer.getService("myService");
   	console.log(service)   
});