Permalink
Browse files

Only setup Static & MailException middleware in production.

  • Loading branch information...
1 parent 0c9c8c6 commit a08986db2b9782e0de6e79590ec2007f1e0cf022 @floehopper floehopper committed Sep 12, 2012
Showing with 18 additions and 15 deletions.
  1. +18 −15 config.ru
View
@@ -5,22 +5,25 @@ require "vanilla/static"
require "rack/contrib/mailexceptions"
use Vanilla::Static, File.join(File.dirname(__FILE__), "public")
-use Rack::Static, :urls => ["/recap/docs"], :root => "/home/freerange/docs/recap"
-use Rack::Static, :urls => ["/mocha/docs"], :root => "/home/freerange/docs/mocha"
-use Rack::MailExceptions do |mail|
- mail.to "everyone@gofreerange.com"
- mail.from "Exception Notifier <exceptions@gofreerange>"
- mail.subject "[gofreerange.com] %s"
- mail.smtp({
- :address => "smtp.gmail.com",
- :port => 587,
- :domain => "gofreerange.com",
- :user_name => "exceptions@gofreerange.com",
- :password => ENV["SMTP_PASSWORD"],
- :authentication => "plain",
- :enable_starttls_auto => true
- })
+if ENV["RACK_ENV"] == "production"
+ use Rack::Static, :urls => ["/recap/docs"], :root => "/home/freerange/docs/recap"
+ use Rack::Static, :urls => ["/mocha/docs"], :root => "/home/freerange/docs/mocha"
+
+ use Rack::MailExceptions do |mail|
+ mail.to "everyone@gofreerange.com"
+ mail.from "Exception Notifier <exceptions@gofreerange>"
+ mail.subject "[gofreerange.com] %s"
+ mail.smtp({
+ :address => "smtp.gmail.com",
+ :port => 587,
+ :domain => "gofreerange.com",
+ :user_name => "exceptions@gofreerange.com",
+ :password => ENV["SMTP_PASSWORD"],
+ :authentication => "plain",
+ :enable_starttls_auto => true
+ })
+ end
end
run Application.new

0 comments on commit a08986d

Please sign in to comment.