Sha256: 1f84fa9d05e4fd6a791032dae4505e3a04b161ee28db0e6f9be6dc16a7d43c97
Contents?: true
Size: 606 Bytes
Versions: 14
Compression:
Stored size: 606 Bytes
Contents
require 'sinatra' require_relative '../module_server' def root File.expand_path( File.dirname( __FILE__ ) ) end get '/' do <<-EOHTML <a href="/some/path.crap?input=bloo">Path</a> EOHTML end get '/some/path.crap' do <<-EOHTML Blah blah blah...#{params['input']} EOHTML end get '/some*' do req = URI.decode( env['PATH_INFO'].gsub( '/some', root ) ).gsub( '\\', '/' ) req << '/' if !req.end_with?( '/' ) #ap req if File.directory?( req ) Dir.glob( req + '*' ).join( '<br/>' ) elsif !File.exists?( req ) 'Does not exist' end end
Version data entries
14 entries across 14 versions & 1 rubygems