Using the GroIMP API it is possible to use GroIMP as a service, or from a remote server.
The API can be installed using the plugin manager, to do so please go on help / plugin manager and select under available plugins the plugin API and press the apply button.
If you want to install the API on a system without a visual user interface you can run the following command:
java -jar core.jar --headless -- -cmd /pluginmanager/commands/installCMD=de.grogra.api
If you use windows and installed GroIMP using the installer, you should have a desktop shortcut, where you normally click on to start GroIMP. To get the same for the API please duplicate (copy paste) the original one and rename it to “GroLink”. Press right click on the new shortcut and select properties. In the properties panel in the field Target, find the part “javaw.exe” and remove the “w” so it becomes “java.exe” (This will keep the ugly black command line window open). Additionally add at the very end of the content of the same filed “ -a api” which instructs GroIMP to start the API.
After applying this changes, you can now click on this short cut and start the API.
To run the API on other devices you have to execute java directly, for example on Ubuntu you can run:
java -Xverify:none -jar /usr/share/GroIMP/core.jar -a api
If you are working on a system without graphics you also have to add –headless
.
After starting the API you can now test it using your web browser. Just go on http://localhost:58081/api/app/ui/commands/app/create?newRGG and you should see a short text such as {“id”:“1”}.
Now you are ready to go with:
Or one of the examples
To stop the API you can just press ctr+c in the console or close the console.