Creating the agent

Now we get to the good stuff!

Creating the on-premise agent.

We will need the following pre-requisites:

  • node v18 or above

  • npm

Lets start by creating a new directory for our connector and going into it:

~/devel$ mkdir lucy-sqlite-connector
~/devel$ cd lucy-sqlite-connector 

Then lets run npm init to setup a new project. Just accept the defaults

devel/lucy-sqlite-connector$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.

Next, lets install the Lucy node.js sdk package as a dependency.

Lets then create a src directory to hold our source code and then add a new index.js file in that directory. That will be the entry point for our code.

(The last command assumes you are using Visual Studio Code as your editor - Replace as appropriate)

Lets open the empty index.js file and add this code:

We'll explain what the code does later.

For now lets just put this in and to get it up and running.

The next step is registering a connector instance and defining our integration.

Last updated