Server Script
The script described here provides the back-end of our plugin
Last updated
The script described here provides the back-end of our plugin
Last updated
The server script, script.js
defines what libraries are imported and is what will get us to our end goal
Before you start, make sure you have an exchange running in on your machine. It is important to have the exchange running in dev mode instead of a standard production CLI setup.
Dev mode exchange has live code updates and any changes in the code will get immediately applied which will make your development experience much better as a developer.
Looking inside the plugins/src/plugins/<YOUR_PLUGIN>
you will see that the created a server folder for us. This is the folder where the config.json
was made.
Create a new file in this server folder called script.js
Code script.js
to whatever goal you have in mind for the plugin (I recommended here looking below at the hello-exchange walkthrough to get an idea of how a script can look)
script.js
is the server-side code that runs during runtime into the server's plugin container. The server script has access to many available in the HollaEx Kit.
The most important library of all is the which has all the main features you need.
Ensure you have executed npm install
before running the command below.
You may also need to add sudo
at the beginning of the command above depending on your OS.
In addition, make sure CORS has been disabled on your browser (this can be tricky in Firefox, so Chrome may be easier to work with).command
Finally, for the run comand to work, you will need python 2 on your machine, this can be installed for Linux with sudo apt install python
To run the script on your dev mode exchange, you need to go to /plugins
and run:
To see if this has worked try accessing localhost:8080/config.json, and you will see the config file of the plugin