I have this simple sinatra web app:
require 'sinatra'
get '/' do
"Success."
end
get '/app' do
"done"
response["Connection"] = "Close"
`sudo pkill blink`
`gpio write 0 0`
`sudo ./blink #{params["func"]}`
end
./blink
is a program that runs forever and does not terminate, so when I access http://127.0.0.1/app?func=2
in a browser, I just get a loading loop and "done"
is not shown as the result, however the program I am trying to run in the /app
block is running.
I thought maybe setting the Connection
header to Close
would solve the problem, but using the code above, which I thought would set the header, still has the Connection
header to Keep-Alive
Any help? Thanks!