This repo contains everything you need to setup any C++ app with a web interface.
We are using ElectronJS to pack the interface inside a window and AJAX APIs to communicate from the Interface to the app using Json requests
First, make sure you have Node.js installed
npm --version
Yarn | Node |
---|---|
yarn install yarn start |
npm install npm start |
- Add your sources inside the template
- Compile with
server.cpp
andlistener.cpp
- name your executable
app.exe
Default port is 444
You can change the port in the.env
file
It is recommended to have a script folder to handle Json requests between the UI and your executable.
You can have a look inside renderer.js
to see how it works.
Basically we're sending an API request on an endpoint which is listened by the c++ server file server.cpp
Have a look inside listener.cpp
, there is a basic processRequest()
function which processes the received json request.
From there, you should be able to feed the output to your other functions