diff --git a/lib/lotus/configuration.rb b/lib/lotus/configuration.rb index 6b2794337..b4d1c0ef7 100644 --- a/lib/lotus/configuration.rb +++ b/lib/lotus/configuration.rb @@ -708,6 +708,43 @@ def scheme(value = nil) end end + # Application route point mount. + # + # Specify a point mount for the application, by passing a String. + # + # By default it's an empty String. + # + # @since x.x.x + # + # @example Getting the value + # require 'lotus' + # + # module Bookshelf + # class Application < Lotus::Application + # end + # end + # + # Bookshelf::Application.configuration.mount_at + # # => nil + # + # @example Setting the value, by passing a block + # require 'lotus' + # + # module Bookshelf + # class Application < Lotus::Application + # configure do + # mount_at 'backend' + # end + # end + # end + # + # Bookshelf::Application.configuration.mount_at + # # => backend + def mount_at(mount_at = '') + @mount_at = mount_at unless mount_at.empty? + @mount_at + end + # The URI host for this application. # This is used by the router helpers to generate absolute URLs. # diff --git a/lib/lotus/loader.rb b/lib/lotus/loader.rb index e038d7f16..8bcfa5d77 100644 --- a/lib/lotus/loader.rb +++ b/lib/lotus/loader.rb @@ -82,6 +82,7 @@ def load_rack! scheme: configuration.scheme, host: configuration.host, port: configuration.port, + mount_at: configuration.mount_at, &configuration.routes )