-
-
Save Sutto/217850 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra/base' | |
| class Bacon < Sinatra::Base | |
| enable :logging, :clean_trace | |
| get '/' do | |
| 'Hello from Sinatra!' | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sinatra' | |
| require 'app.rb' | |
| set :environment, (ENV["RACK_ENV"] || :production).to_sym | |
| disable :run | |
| log_dir = File.join(root_dir, "log") | |
| FileUtils.mkdir_p(log_dir) | |
| log = File.open(File.join(log_dir, "web-app.log"), "a") | |
| # The Important Part iirc | |
| $stdout.reopen(log) | |
| $stderr.reopen(log) | |
| run Bacon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment