The script described here provides the back-end of our plugin
The server script,
script.jsdefines what libraries are imported and is what will get us to our end goal
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.
- 1.Create a new file in this server folder called
script.jsto 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)
If at any point, you become unsure of the structure of either your plugin's folders or the code within the files themselves, take a look at the hello-exchange example on GitHub to see how plugin structure should be organized.
Ensure you have executed
npm installbefore running the command below.
You may also need to add
sudoat 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
npm start --plugin=<PLUGIN_NAME>
Remember this will need to be done in a new terminal as dev mode will block any input on the terminal it was started on
To see if this has worked try accessing localhost:8080/config.json, and you will see the config file of the plugin