In this example you can explore how to integrate React in DataKernel projects. You can find full example sources on GitHub.
Here we will consider DataKernel HttpServerLauncher and AsyncServlet which are used to set up the server, which processes the requests. See how DataKernel makes this process extremely simple.
SimpleApplicationLauncher extends DataKernel HttpServerLauncher:
HttpServerLauncher takes care of setting up all the needed configurations for HTTP server.
Provide AsyncServlet, which will open the index.html of the provided path.
Then write down main method, which will launch SimpleApplicationLauncher. And that’s it, no additional configurations are required.
If you want to run the example, clone DataKernel and import it as a Maven project. Before running the example, build the project (Ctrl + F9 for IntelliJ IDEA).
Run the following command in example’s folder in terminal:
SimpleApplicationLauncher class and run its main() method.
Then open your favourite browser and go to localhost:8080.