Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 374 Bytes
require 'rubygems'
require 'sinatra'
require 'main'
root_dir = File.dirname(__FILE__)
set :environment, ENV['RACK_ENV'].to_sym
set :root, root_dir
set :app_file, File.join(root_dir, 'main.rb')
disable :run
FileUtils.mkdir_p 'log' unless File.exists?('log')
log = File.new("log/sinatra.log", "a")
$stdout.reopen(log)
$stderr.reopen(log)
run Sinatra::Application