-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.rb
34 lines (28 loc) · 780 Bytes
/
app.rb
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
34
# The main class for the kw-api
class SpeechieAPI < Sinatra::Base
enable :sessions
configure :production do
set :haml, ugly: true
set :clean_trace, true
end
configure :development do
# ...
end
configure do
# Datamapper timezone workaround
ENV['TZ'] = 'utc'
set :telegram_token, ENV['TELEGRAM_TOKEN']
set :bot_username, ENV['BOT_USERNAME']
set :google_speech_api_key, ENV['GOOGLE_SPEECH_API_KEY']
end
helpers do
include Rack::Utils
alias_method :h, :escape_html
end
end
# Load helpers first so they are available even to lib
require_relative 'helpers/init'
# lib should be required first so it is available as soon as possible
require_relative 'lib/init'
require_relative 'models/init'
require_relative 'routes/init'