Understanding the structure of the connector
Now that we have the connector up and running - lets see the different parts of the code and how it works.
There are two important bits that every connector has:
This function is responsible for receiving the payload from Lucy, executing it and returning a result. It's an async function so make sure you use Promises and async/await in order to make the connector efficient.
The other important bit is the last bit at the bottom:
This code initializes the connector using the installation key as previously mentioned.
Its loading it from an environment variable and creating the connector.
Next, we call the init()
function in order to begin the purpose of establishing server connectivity.
When the init() promise resolves, we are good to go.
Last updated