Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 静态网站链接在Heroku上不起作用_Html_Css_Rack - Fatal编程技术网

Html 静态网站链接在Heroku上不起作用

Html 静态网站链接在Heroku上不起作用,html,css,rack,Html,Css,Rack,我使用RACK()在heroku上部署了一个静态网站。 它工作得很好。 但是当我点击链接时,它不起作用,其他页面也不显示? 请任何人帮忙 这在Heroku上非常适合我 Html: <a href="/contact.html"> Contact Us </a> 可能重复的 use Rack::Static, :urls => ["/images", "/js", "/css"], :root => "public" static_page_mapp

我使用RACK()在heroku上部署了一个静态网站。 它工作得很好。 但是当我点击链接时,它不起作用,其他页面也不显示?
请任何人帮忙

这在Heroku上非常适合我

Html:

<a href="/contact.html"> Contact Us </a>
可能重复的
use Rack::Static,
  :urls => ["/images", "/js", "/css"],
  :root => "public"

static_page_mappings = {
  '/'             => 'public/index.html',
  '/contact.html' => 'public/contact.html'
}

static_page_mappings.each do |req, file|
  map req do 
    run Proc.new { |env|
      [
        200, 
        {
          'Content-Type'  => 'text/html', 
          'Cache-Control' => 'public, max-age=6400',
        },
        File.open(file, File::RDONLY)
      ]
    }
  end
end