【发布时间】:2023-10-29 14:54:01
【问题描述】:
我刚刚将一个静态页面作为静态机架应用程序部署到 Heroku。我的 config.ru:
use Rack::Static,
:urls => ["/stylesheets", "/images"],
:root => "public",
:index => "public/index.html"
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('public/index.html', File::RDONLY)
]
}
现在我想将所有请求重定向到这个静态 index.html 文件。任何想法如何实现这一目标?
【问题讨论】: