Skip to content

Commit

Permalink
Fix non-root deployment. (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
arscan committed Oct 13, 2023
1 parent bd21e7c commit 30ff22b
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
require 'inferno'

inferno_spec = Bundler.locked_gems.specs.find { |spec| spec.name == 'inferno_core' }

base_path =
if inferno_spec.respond_to? :stub
inferno_spec.stub.full_gem_path
elsif inferno_spec.source.is_a? Bundler::Source::Path
inferno_spec.source.path.to_s
elsif inferno_spec.source.specs.local_search('inferno_core').present?
inferno_spec.source.specs.local_search('inferno_core').first.full_gem_path
else
raise 'Unable to locate inferno static assets'
end

inferno_path = File.join(base_path, 'lib', 'inferno')

use Rack::Static, urls: ['/public'], root: inferno_path
use Rack::Static,
urls: Inferno::Utils::StaticAssets.static_assets_map,
root: Inferno::Utils::StaticAssets.inferno_path

Inferno::Application.finalize!

Expand Down

0 comments on commit 30ff22b

Please sign in to comment.