Sha256: 0a87f36239511c4cdc3c0e73695245839326f77d6e6c7c0ff6f433bfd503cbba
Contents?: true
Size: 530 Bytes
Versions: 3
Compression:
Stored size: 530 Bytes
Contents
get %r{\.cjs$} do path = request.path.sub(/\.cjs$/, '.js').sub(%r{^/}, './') pass unless File.exists? path response.header['Content-type'] = 'application/x-javascript; charset=UTF-8' begin Uki.include_js(path) rescue Exception => e message = e.message.sub(/\n/, '\\n') "alert('#{message}')" end end get %r{.*} do path = request.path.sub(%r{^/}, './') path = File.join(path, 'index.html') if File.exists?(path) && File.directory?(path) p path pass unless File.exists?(path) send_file path end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
uki-1.0.2 | lib/uki/routes.rb |
uki-1.0.1 | lib/uki/routes.rb |
uki-1.0.0 | lib/uki/routes.rb |