User Tools

Site Tools


sib:lstnclr

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
sib:lstnclr [2019/08/28 06:58]
ozzy
sib:lstnclr [2019/08/28 07:12] (current)
ozzy
Line 112: Line 112:
 ==== Setting up a general caller ==== ==== Setting up a general caller ====
  
-We will now create the General caller.+We will now create the General caller. ​In this example the caller will simply return a message depending on the input. In a real situation, of course, the caller would call some other system and then return the response. 
 + 
 +General callers are the simplest caller type - it really does not do much. Instead it is up to the developer to write code in the getData function. You may notice that there is currently no RESTCaller implemented in the SIB. This is because http requests are so easy to make in NodeJS, so we have been using the general caller for this type of functionality. 
  
   * In the //​mycaller//​ directory, create a file called //​mycaller.js//​. This file will be the starting point for the caller and in it we will create and start an instance of the sib_generalcaller class as follows:   * In the //​mycaller//​ directory, create a file called //​mycaller.js//​. This file will be the starting point for the caller and in it we will create and start an instance of the sib_generalcaller class as follows:
Line 127: Line 130:
   * Browse to the GeneralCaller documentation:​ http://​wiki.stilit.se/​doku.php?​id=sib:​callers:​generalcaller   * Browse to the GeneralCaller documentation:​ http://​wiki.stilit.se/​doku.php?​id=sib:​callers:​generalcaller
   * Copy the //custom configuration//​ code into your //​custom.js//​ file   * Copy the //custom configuration//​ code into your //​custom.js//​ file
 +  * Insert the following line at row 1:
 +    <code javascript>"​use strict";</​code>​
  
 Make the following changes in the caller custom.js file: Make the following changes in the caller custom.js file:
sib/lstnclr.txt · Last modified: 2019/08/28 07:12 by ozzy