I have a C++ application that currently has console output.
I want to add a simple web front-end to this application to allow me to view its output remotely.
Eventually, I would like to add some buttons to control the back end application, as well as some charting capabilities to visualize the data.
I’ve looked into Wt, briefly, but it seems like it’s putting too much of the front end in the back end.
I’d like to be able to use the more popular web front ends, like JQuery and MooTools.
Currently I’m using my Windows desktop to prototype, but I’d like the solution to be able to eventually run on Linux, with Apache as the web server.
What is the best way to create the binding between the front and back ends?
One quick-and-dirty method i sometimes use is to write a perl cgi wrapper that runs the application and captures it’s output:
For when you get around to controlling it, you can add a form to the website. Basically, if param() has data in it, use that data to parse a set of switches for the C++ application. If no switches are defined, display a form with a set of checkboxes and buttons that, when submitted, will parse into switches and the application will be launched with them.
Warning: If you’re parsing form-input into switches, be absolutely 100% sure that it’s parsed in such a way that it can’t be tainted with, for example, a:
…in the parameters returned from the form.