heroku - Public Directory Not Being Served With Sinatra -
as title says, cannot heroku use public assets.
locally, when running app shotgun
works. rackup
(what heroku uses), css , assets 404.
i've tried bunch of answers on here (one, two, three) none have worked.
here's directory structure:
my config.ru:
require 'bundler' bundler.require require file.expand_path('../config/environment', __file__) run bikeshareapp
and controller:
class bikeshareapp < sinatra::base '/' erb :'home/index' end '/stations' @stations = station.all erb :'stations/index' end end
edit: how i'm referencing assets way
<link href="/css/bootstrap.min.css" rel="stylesheet"> <link href="/css/overwrite.css" rel="stylesheet">
found it.
following this guide , putting in config.ru worked:
run lambda { |env| [ 200, { 'content-type' => 'text/html', 'cache-control' => 'public, max-age=86400' } ] }
Comments
Post a Comment