mirror of
https://github.com/moparisthebest/mailcatcher
synced 2024-11-01 07:55:05 -04:00
22 lines
455 B
Ruby
22 lines
455 B
Ruby
require "active_support/core_ext/module/delegation"
|
|
require "rack/builder"
|
|
|
|
require "mail_catcher/web/application"
|
|
|
|
module MailCatcher
|
|
module Web extend self
|
|
def app
|
|
@@app ||= Rack::Builder.new do
|
|
if ENV["MAILCATCHER_ENV"] == "development"
|
|
require "mail_catcher/web/assets"
|
|
map("/assets") { run Assets }
|
|
end
|
|
|
|
map("/") { run Application }
|
|
end
|
|
end
|
|
|
|
delegate :call, :to => :app
|
|
end
|
|
end
|