aboutsummaryrefslogtreecommitdiff
path: root/web/config.ru
blob: b2208163fbedc93b69a5d2b49025e50a12c6b472 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
#  For use with Phusion Passenger
#

Encoding.default_external = 'UTF-8'

require 'sinatra'
require './taginfo.rb'
require 'json'
require 'lib/config.rb'

TaginfoConfig.read

LOGDIR=TaginfoConfig.get('logging.directory', '/osm/taginfo/var/log');
 
set :run, false
set :environment, :production

today = Time.now.strftime('%Y-%m-%d')
log = File.new("#{LOGDIR}/taginfo-#{ today }.log", "a")
log.sync = true

# https://github.com/joto/taginfo/issues/34
#$stdout.reopen(log)
$stderr.reopen(log)

$stderr.puts "Taginfo started #{Time.now}"

$queries_log = File.new("#{LOGDIR}/queries-#{ today }.log", "a")
$queries_log.sync = true

run Taginfo