lib/bjond-app-definition.rb in bjond-api-0.1.0 vs lib/bjond-app-definition.rb in bjond-api-0.1.1

- old
+ new

@@ -4,8 +4,14 @@ class BjondAppDefinition attr_accessor :id, :author, :name, :description, :rootEndpoint, :configURL, :iconURL, :rootEndpoint, :integrationEvent, :integrationConsequence def initialize() self.id = SecureRandom.uuid + self.configURL = "http://#{self.get_hostname}/bjond-app/services" + self.rootEndpoint = "http://#{self.get_hostname}/bjond-app/services" + end + + def get_hostname() + Rails.application.config.action_controller.default_url_options ? Rails.application.config.action_controller.default_url_options[:host] : nil || `hostname` end end end \ No newline at end of file