This is a demo video of B4J Print Server which is a REST API Web Server. The server can run on Windows and Linux including on a Raspberry Pi OS.
I have also created B4J, B4A and B4i Client app to send request to the server through GET and POST. The print data can contain ESC/POS string sent through JSON.
Sorry, I am not sharing the code for the time being. This post is to show B4X is able to create this kind of solution.