More fixes

This commit is contained in:
Paulus Schoutsen 2015-10-27 00:53:57 -07:00
parent e59252a39b
commit 8f47eb20e5
12 changed files with 30 additions and 232 deletions

View file

@ -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