More fixes
This commit is contained in:
parent
e59252a39b
commit
8f47eb20e5
12 changed files with 30 additions and 232 deletions
|
@ -16,7 +16,7 @@ class SinatraStaticServer < Sinatra::Base
|
|||
|
||||
def send_sinatra_file(path, &missing_file_block)
|
||||
file_path = File.join(File.dirname(__FILE__), 'public', path)
|
||||
file_path = File.join(file_path, 'index.html') unless file_path =~ /\.[a-z]+$/i
|
||||
file_path = File.join(file_path, 'index.html') if File.directory?(file_path)
|
||||
File.exist?(file_path) ? send_file(file_path) : missing_file_block.call
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue