Heroku で静的ファイルを提供する単純なラック アプリケーションを作成します。しかし、アプリケーションをローカルで実行しようとすると、rackup
. ファイルを継続的に要求しているように見えます。これにより、Chrome でタブがハングします。
私が抱えている問題とその修正方法は何ですか?
config.ru
use Rack::Static,
:urls => ["/images", "/scripts", "/styles", "/components"],
:root => "public"
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('public/index.html', File::RDONLY)
]
}
そしてエラー:
...
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /scripts/scripts.js?_=1362996702033 HTTP/1.1" 200 8543 0.0007
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/jquery/jquery.min.js?_=1362996702034 HTTP/1.1" 200 92629 0.0021
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/jquery-ui/ui/minified/jquery-ui.custom.min.js?_=1362996702035 HTTP/1.1" 200 228147 0.0041
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/angular-strap/dist/angular-strap.min.js?_=1362996702040 HTTP/1.1" 200 11632 0.0010
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/bootstrap/docs/assets/js/bootstrap.min.js?_=1362996702041 HTTP/1.1" 200 28545 0.0010
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/angular-ui/build/angular-ui.min.js?_=1362996702042 HTTP/1.1" 200 17515 0.0009
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/angular-ui/build/angular-ui-ieshiv.min.js?_=1362996702043 HTTP/1.1" 200 1018 0.0006
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /scripts/scripts.js?_=1362996702044 HTTP/1.1" 200 8543 0.0007
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/jquery/jquery.min.js?_=1362996702045 HTTP/1.1" 200 92629 0.0021
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/jquery-ui/ui/minified/jquery-ui.custom.min.js?_=1362996702046 HTTP/1.1" 200 228147 0.0041
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/angular-strap/dist/angular-strap.min.js?_=1362996702051 HTTP/1.1" 200 11632 0.0007
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/bootstrap/docs/assets/js/bootstrap.min.js?_=1362996702052 HTTP/1.1" 200 28545 0.0060
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/angular-ui/build/angular-ui.min.js?_=1362996702053 HTTP/1.1" 200 17515 0.0008
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /components/angular-ui/build/angular-ui-ieshiv.min.js?_=1362996702054 HTTP/1.1" 200 1018 0.0006
127.0.0.1 - - [11/Mar/2013 11:11:43] "GET /scripts/scripts.js?_=1362996702055 HTTP/1.1" 200 8543 0.0007
...