3

我有一个应用程序,其中有一个htdocs包含静态文件的文件夹和几个 CGI 脚本httpd/cgi-bin。我如何使用 Rackconfig.ru来服务这个应用程序?

我的当前config.ru

map "/check" do
  What here  ("httpd/cgi-bin/check_wrapper.sh")
end

run Rack::Directory.new("htdocs")
4

1 回答 1

1

您可以使用反引号来运行命令并获取输出。

map "/check" do
  run Proc.new { |env| [200, {"Content-Type" => "text/html"}, [`./httpd/cgi-bin/check_wrapper.sh`] ] } 
end

run Rack::Directory.new("htdocs")
于 2012-11-07T05:56:31.307 回答