Scripting
So to get started with the hello-exchange server script, first we are going to need to make the actual script that will be run:
- 1.Create a new file called
script.js
, in the same directory as theconfig.json
(plugins/src/plugins/hello-exchange/server/script.js
) - 2.Fill this
script.js
with the code found in the box below.
1
'use strict';
2
3
const { publicMeta, meta } = this.configValues;
4
const {
5
app,
6
loggerPlugin,
7
toolsLib
8
} = this.pluginLibraries;
9
const helloWorld = require('hello-world-npm');
10
const moment = require('moment');
11
12
const init = async () => {
13
loggerPlugin.info(
14
'HELLO-PLUGIN PLUGIN initializing...'
15
);
16
17
if (!meta.private_message.value) {
18
throw new Error('Configuration value private required');
19
}
20
};
21
22
init()
23
.then(() => {
24
app.get('/plugins/hello-plugin/info', (req, res) => {
25
loggerPlugin.verbose(
26
req.uuid,
27
'GET /plugins/hello-plugin/info'
28
);
29
30
return res.json({
31
public_message: publicMeta.public_message.value,
32
private_message: meta.private_message.value,
33
library_message: helloWorld(),
34
moment_timestamp: moment().toISOString(),
35
exchange_info: toolsLib.getKitConfig().info
36
});
37
});
38
})
39
.catch((err) => {
40
loggerPlugin.error(
41
'HELLO-PLUGIN PLUGIN error during initialization',
42
err.message
43
);
44
});
Check the screenshot below to compare and make sure you have the file in the correct location.

Now we have constructed 'hello-plugin', let's call the endpoint. First, we will need to build the plugin.
- 1.If the terminals from earlier (when following how to set up dev mode) are no longer up, lets first get them going.
- 1.In one terminal navigate to hollaex-kit/server and run
docker-compose up
- 2.In the other, enter the docker container with:
docker exec -it server_hollaex-kit-server_1 /bin/bash
- 2.With both the containers running build the plugin by running:
node plugins/dev.js --plugin=hello-plugin
inside the container (terminal we ran 'docker exec...' in)
Great news! This is all we had to do, and can now have a look at the plugin in the browser through the following URL:
You should see an output similar to below:

Chrome

Firefox
Last modified 11d ago