So, I've got a sinatra app I'm working on with the app hosting several different microsites for clients. The way I have my public and views directory structured is like so:
sites/
site1/
public/
style.css
views/
layout.haml
general.haml
site2/
public/
style.css
views/
layout.haml
general.haml
Now, when the request comes in I've got the following two lines:
set :views, Proc.new { File.join(root, "sites/#{site}/views") }
set :public, Proc.new { File.join(root, "sites/#{site}/public") }
When the incoming request comes in, and site gets defined as "site1" the views work exactly as desired with them rendering out of the appropriate folder. However, a call to the "/style.css" route returns a 404 error.
When I make the public directory in the app root and place style.css there it works fine. However, I need this to work on a site-by-site basis. I'm going off of the official docs by Sinatra but it still is not working, even if I set
enable :static
or if I use
set :static, true
As described in the docs. Any ideas?