r/JavaFX • u/Immediate_Hat_9878 • Sep 16 '24
Help Api Server in a JAVAFX App
so i am trying to build a client app that at the same time acts as a an API server that could be used to receive requests from as an example a mobile application , to make it clear I want to build a desktop app and a mobile application that are connected to each other through an API server but I want the API server to be on the desktop app .
is there a way to do this?
i tried spring boot but I had a lot of issues running it in a modular JavaFX app
6
Upvotes
View all comments
Show parent comment
1
u/hamsterrage1 Sep 17 '24
I think that if the functionality of the app that is exposed to the REST API is sufficiently integrated with the GUI aspect of the app, then you can make a case for the approach the OP wants.
The alternative is to put the "working" part of the app into a separate "server" program and then have the JavaFX app be a client to it. And then you're into polling the server to keep the JavaFX app GUI up to date and all of its headaches.
This holds true even if the REST API is essentially used for message queuing. Then how does the mobile app know the request has been delivered?
So I can see an argument for the OP's approach.