lib/template/config.ru in browser_app_base-0.0.8 vs lib/template/config.ru in browser_app_base-0.0.9

- old
+ new

@@ -28,10 +28,25 @@ content_type "text/json", :charset => "utf-8" puts "#{file}.#{ext}" File.read "config/#{file}.#{ext}" end +post "/history/*.*" do |file, ext| + content_type "text/json", :charset => "utf-8" + puts "#{file}.#{ext}" + p = params[:param1] + buf = File.read "history/#{file}.#{ext}" + data = eval(buf) + if data != nil + if p != "" + JSON.generate data.find_all { |d| d =~ Regexp.new(p) } + else + JSON.generate data + end + end +end + get "/open_dialog" do dialog_html = <<'EOS' <!DOCTYPE html> <html> <head> @@ -72,8 +87,8 @@ # Thread.start { # } end -#\ --port 53492 +#\ --port 61047 run Sinatra::Application