I would like to implement an application with Scala and HTML5. My idea was to create a "local" client-server architecture: Scala processes the calculations and generates HTML5 as a graphical interface.
In my opinion, there are two possibilities
- Use the Java / Scala framework, which allows embedded HTML5. For example, SWT has a browser widget. JavaFX also seems good.
- Distribute the program on the server and run it in a browser on local hosting.
Perhaps it would be most convenient to require an Internet connection and forget about the local host. Unfortunately, offline mode is required.
Now I would like to know how to do this correctly:
- The first option seems easier to implement, but I wonder: how can I communicate with Javascript without the HTTP protocol?
- The second approach was just an idea. Have you ever done something like this?
If you have tips or you know a good framework, please continue.
UPDATE:
I got an interesting idea: can I use nodejs to create something like server-server architecture?
Right now, the relationship between Scala and Coffescript seems to be the most problematic part. I'm still wondering how I can initiate an update from the Scala application. An HTTP request is a good way to exchange data. Unfortunately, as far as I know, in the βstandardβ Coffeescript there would be no event hook for listening to HTTP messages on the server side.
I was thinking about using nodejs to listen for data sent by the server. Is that a good idea?
source share