Refactor LetterOpenerWeb mounting condition

Prevent any attempt to access `LetterOpenerWeb` when running in production.
This commit is contained in:
Chris Hennes 2025-10-14 10:32:41 -05:00 committed by GitHub
parent 688a8e3561
commit 0ede7d550a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,8 @@
Osem::Application.routes.draw do
mount LetterOpenerWeb::Engine, at: '/letter_opener' if Rails.env.development?
if Rails.env.development? && defined?(LetterOpenerWeb)
mount LetterOpenerWeb::Engine, at: '/letter_opener'
end
constraints DomainConstraint do
get '/', to: 'conferences#show'
end