# -*- coding: utf-8 -*- require "sinatra" require "sinatra/contrib" require "sinatra-websocket" require "thin" require "json" require "./server" require "./wsserver" get "/" do File.read("index.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 get "/js/:name.js" do content_type "text/javascript", :charset => "utf-8" puts "js/#{params[:name]}.js" File.read "js/#{params[:name]}.js" end get "/config/*.*" do |file, ext| content_type "text/json", :charset => "utf-8" puts "#{file}.#{ext}" File.read "config/#{file}.#{ext}" end get "/open_dialog" do dialog_html = <<'EOS'