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

- old
+ new

@@ -6,14 +6,26 @@ require "json" require "./server" require "./wsserver" +temp_dir = ENV["temp"] +temp_dir = "/tmp" if temp_dir == nil +puts "temp_dir=#{temp_dir}" +access_log = File.new("#{temp_dir}/logs/sinatra.log", "a+") +access_log.sync = true +use Rack::CommonLogger, access_log + get "/" do - File.read("index.html") + File.read("html/index.html") end +get "*.html" do |file| + content_type "text/html", :charset => "utf-8" + File.read "./html/#{file}.html" +end + get "/css/:name.css" do content_type "text/css", :charset => "utf-8" puts "css/#{params[:name]}.css" File.read "css/#{params[:name]}.css" end @@ -78,17 +90,17 @@ puts res end configure do set :DoNotReverseLookup, true - set :logging, false + set :logging, true set :default_encoding, "utf-8" set :server, :thin # Thread.start { # } end -#\ --port 61047 +#\ --port 36809 run Sinatra::Application