kibana/server
2014-08-20 17:38:06 -07:00
..
bin Kibana Backend Server 2014-08-20 17:36:32 -07:00
config Kibana Backend Server 2014-08-20 17:36:32 -07:00
lib Kibana Backend Server 2014-08-20 17:36:32 -07:00
public Kibana Backend Server 2014-08-20 17:36:32 -07:00
routes Kibana Backend Server 2014-08-20 17:36:32 -07:00
Gemfile Kibana Backend Server 2014-08-20 17:36:32 -07:00
Gemfile.lock Kibana Backend Server 2014-08-20 17:36:32 -07:00
Rakefile Kibana Backend Server 2014-08-20 17:36:32 -07:00
README.md Fixing the indent on the project layout section 2014-08-20 17:38:06 -07:00

Backend Server For Kibana 4

This is the backend server for Kibana 4. It's written in Ruby using Sinatra and the Puma rack server. It's written to be compatible with JRuby and distributed as a jar file.

Requirements

  • Serve Static Files for Kibana
  • Proxy requests to Elasticsearch
  • Distributable an executable jar
  • Platform for developing API endpoints for Kibana

Configuration

Coming Soon...

Project Layout

  • bin - Where the kibana executable lives. This is the entry point for the Jar file
  • config - Configuration files for warble, puma and the rack server
  • lib - Where Kibana specific ruby libraries live
  • public - This is where the static assets go
  • routes - This is where the route controllers go
  • Gemfile - This is the Gemfile for Bundler. Any dependencies need to be listed in here.
  • Gemfile.lock - Bundler creates a lock file for the gem versions
  • Rakefile - This is where the rake tasks go
  • README.md - You're looking at it :D

Development Evn Setup

Coming Soon...

Build Process

Coming Soon...

Adding New Routes to the Project

Create a route class in routes

require "rotues/base"

module Kibana
  module Routes
    class MyNewRoute < Base

      get '/my-route/' do
        json :something => 'fancy'
      end

    end
  end
end

Require the route in lib/app at the top of the file

require "routes/home"
require "routes/api"
require "routes/my_new_route"

Now add the route to the class

    # Rack middleware goes here
    use Rack::ReverseProxy do
      reverse_proxy /^\/elasticsearch(.*)$/, 'http://localhost:9200$1'
    end

    # Routes go here
    use Routes::Home
    use Routes::Api
    use Routes::MyNewRoute
  end
end