Skip to content

Commit

Permalink
fix setup error when host environment variable was not set
Browse files Browse the repository at this point in the history
  • Loading branch information
ezekg committed May 10, 2024
1 parent d99ce12 commit 6c02743
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ class Application < Rails::Application

# Set default URL options before server boots
config.before_initialize do |app|
app.default_url_options = {
host: ENV.fetch('KEYGEN_HOST'),
protocol: 'https',
}
app.default_url_options = { protocol: 'https' }.tap do |options|
options[:host] = ENV['KEYGEN_HOST'] if ENV.key?('KEYGEN_HOST')
end
end

# Print env info when server boots
Expand Down

0 comments on commit 6c02743

Please sign in to comment.