More accessible, still not good environment based settings

This commit is contained in:
2025-09-20 18:06:18 -05:00
parent e04400d1df
commit 54f86078f5
5 changed files with 14 additions and 15 deletions
+1 -5
View File
@@ -1,10 +1,6 @@
class SupplierController < Suppliers::ApplicationController class SupplierController < Suppliers::ApplicationController
def home def home
if Rails.env.development? redirect_to "#{Mozo.supplier_url}/#{params[:other]}"
redirect_to "https://localhost:4202/supplier/#{params[:other]}"
else
redirect_to "https://supplier.mozo.bar/supplier/#{params[:other]}"
end
end end
=begin =begin
# GET /suppliers/1/active_orders # GET /suppliers/1/active_orders
+1 -4
View File
@@ -6,10 +6,7 @@ module ApplicationHelper
end end
def user_root_path def user_root_path
case Rails.env Mozo.user_url
when 'development' then 'https://localhost:4201/'
else 'https://user.mozo.bar/'
end
end end
def user_dynamic_data_host def user_dynamic_data_host
+1 -4
View File
@@ -2,7 +2,4 @@
iframe.phone-content-frame src=user_root_path iframe.phone-content-frame src=user_root_path
.tablet-wrapper .tablet-wrapper
- if Rails.env.development? iframe.tablet-content-frame src=Mozo.supplier_url
iframe.tablet-content-frame src="https://localhost:4202/supplier/"
- else
iframe.tablet-content-frame src="https://supplier.mozo.bar/supplier/"
+6 -2
View File
@@ -1,7 +1,11 @@
if Rails.env.development? if Rails.env.development?
Mozo.event_host = "http://localhost:9296/faye" Mozo.event_host = 'http://localhost:9296/faye'
Mozo.supplier_url = 'https://localhost:4202/supplier'
Mozo.user_url = 'https://localhost:4201'
else else
Mozo.event_host = "https://events.mozo.bar/faye" Mozo.event_host = "https://events.mozo.bar/faye"
Mozo.supplier_url = "https://supplier.mozo.bar/supplier"
Mozo.user_url = 'https://user.mozo.bar'
end end
Mozo.broadcaster = Mozo::Broadcaster::Faye.new Mozo.broadcaster = Mozo::Broadcaster::Faye.new
+5
View File
@@ -1,6 +1,11 @@
module Mozo module Mozo
# Settings handled in config/initializers/mozo_settings.rb
mattr_accessor :event_host mattr_accessor :event_host
mattr_accessor :broadcaster mattr_accessor :broadcaster
mattr_accessor :supplier_url
mattr_accessor :user_url
# Autoloading
extend ActiveSupport::Autoload extend ActiveSupport::Autoload
autoload :Distribution autoload :Distribution
autoload :Serializer autoload :Serializer