Get started turning a desktop executable to a very basic web application

April 28, 2016 284 views
Deployment DigitalOcean


I have been using a DigitalOcean Ubuntu server (512 MB Memory / 20 GB Disk / LON1) for several months. I host on it a website of WordPress (Nginx), which works well.

Now, I have a totally different project. I want to turn an existing desktop application into a web application. The desktop application was developed by myself in OCaml under Linux. I have compiled it into an executable, so that we can run it in a command line: "name -parameters arg0 arg1 ...", and it returns some results.

To turn it into a web application, on the client side, I will use JavaScript. The code will call the the executable that I will put on the server, and receive some results. However, I have no idea how to do it in details. For instance,

1) where should I put this executable "name" in the server?
2) what code should I write in the server?
3) what exact code should I write on the client side in JavaScript to call the executable, pass parameters and arguments, and receive the results?

Could anyone point me to some samples to let me get started?

Thank you


1 Answer

What exact code should I write....

We won't write your code for you. You'll need to build a wrapper on the server-side to create either a JSON response or a web DIV on the client-side that will print the output.

The server-side can be in any language you want, for example:

  • Node.js
  • Ruby/Rails
  • PHP
  • Go
  • Python/Flask
  • Perl
  • Java/Tomcat

You'll have to pick a language, learn the language, then write the code. I would recommend a web service that works as a RESTful API, that will take the client request, sanitize it, then pass it to your application.

Have another answer? Share your knowledge.