lib/lotus/routing/http_router.rb in lotus-router-0.1.0 vs lib/lotus/routing/http_router.rb in lotus-router-0.1.1

- old
+ new

@@ -91,9 +91,21 @@ # @api private def options(path, options = {}, &blk) add_with_request_method(path, :options, options, &blk) end + # Allow to mount a Rack app + # + # @see Lotus::Router#mount + # + # @since 0.1.1 + # @api private + def mount(app, options) + add("#{ options.fetch(:at) }*").to( + @resolver.resolve(to: app) + ) + end + # @api private def reset! uncompile @routes, @named_routes, @root = [], Hash.new{|h,k| h[k] = []}, Node::Root.new(self) @default_host, @default_port, @default_scheme = 'localhost', 80, 'http'