forked from rdsubhas/ruby-deploy-kickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyapp.rb
More file actions
27 lines (21 loc) · 620 Bytes
/
myapp.rb
File metadata and controls
27 lines (21 loc) · 620 Bytes
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
require 'sinatra'
require 'sinatra/reloader' if development?
require 'rack-mini-profiler' if development?
require 'json'
class Myapp < Sinatra::Base
configure :development do
# Enable hot reloading in development mode
register Sinatra::Reloader
use Rack::MiniProfiler
end
# Enable request logging
set :logging, true
# If you're planning to proxy behind nginx,
# Then you can move this bind inside `configure :development`
set :bind, '0.0.0.0'
# A simple endpoint
get '/' do
config = ENV.select{ |k,v| k =~ /^MYAPP_/ }
return "Running with config: #{config.inspect}"
end
end