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:

dir struct

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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -