Sha256: 1b1cf5eba02d58ecce6583f3e5305e9c253c5c96d430d9dcbf5baf72035bcf1a

Contents?: true

Size: 865 Bytes

Versions: 4

Compression:

Stored size: 865 Bytes

Contents

require "logstash/api/modules/base"
require "logstash/api/modules/node"
require "logstash/api/modules/node_stats"
require "logstash/api/modules/plugins"
require "logstash/api/modules/root"
require "logstash/api/modules/stats"

module LogStash
  module Api
    module RackApp
      def self.app
        namespaces = rack_namespaces 
        Rack::Builder.new do
          run LogStash::Api::Modules::Root
          namespaces.each_pair do |namespace, app|
            map(namespace) do
              run app
            end
          end
        end
      end

      def self.rack_namespaces
        {
          "/_node" => LogStash::Api::Modules::Node,
          "/_stats" => LogStash::Api::Modules::Stats,
          "/_node/stats" => LogStash::Api::Modules::NodeStats,
          "/_plugins" => LogStash::Api::Modules::Plugins
        }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
logstash-core-5.0.0.alpha3-java lib/logstash/api/rack_app.rb
logstash-core-5.0.0.alpha3.snapshot8-java lib/logstash/api/rack_app.rb
logstash-core-5.0.0.alpha3.snapshot7-java lib/logstash/api/rack_app.rb
logstash-core-5.0.0.alpha3.snapshot6-java lib/logstash/api/rack_app.rb