This is my first SE question. Usually I can find the answer to something quite easily through this wonderful site, but, unfortunately, about this I can not find anything in what I am looking for, here or elsewhere. Let me explain the problem:
I wrote a C ++ program to do numerical calculations. It takes command line arguments and writes to stdout and works fine on my OSX system.
I want to host this online site for my peers to try it more easily, so I wrote some Node.js and Express code to get the input from the form and provide this as a command line argument for the executable. Then I execute the binary called a "factorizer" as follows:
const exec = require('child_process').exec; app.post('/', function (req, res) { var input = req.body.numberinput;
The above works fine on my local machine, but when I deploy it to Heroku and then try entering (here I tried 2131), I get an error:
Error: Command failed: ./numericcomp 2131 ./numericcomp: 3: ./numericcomp: Syntax error: word unexpected (expecting ")")
which is assigned to the callback in exec.
So, I really donβt know what to do, the problem is that Heroku just does not start the executable correctly. I'm not particularly aware of how Heroku works, I read information about buildpacks, etc., but it seems like a very complicated process just to execute binary code. Is it because I have only one speaker and it cannot start the child process?
I would really appreciate it if someone could point me in the right direction here, it seems that I have done all the hard work, but I can not overcome the last obstacle.