Class: Server::Base

Inherits:
Sinatra::Base
  • Object
show all
Extended by:
Auth::Authorization, JunglePath::API::Helpers::Defaults, JunglePath::API::Helpers::StandardAPIs
Defined in:
lib/jungle_path/app/api/base.rb

Overview

class BaseAPI < Sinatra::Application

Direct Known Subclasses

API

Defined Under Namespace

Modules: Database

Class Method Summary collapse

Methods included from JunglePath::API::Helpers::Defaults

set_default_authentication_check, set_default_error_handling, set_default_helpers, set_default_rack_middleware

Methods included from JunglePath::API::Helpers::StandardAPIs

get_forward_host, set_standard_api_default_html_page, set_standard_api_get_log_file, set_standard_api_get_log_file_list, set_standard_api_query, set_standard_api_sample_queries_list, set_standard_forward_api, set_standard_keys_api, set_standard_users_api

Methods included from Auth::Authorization

authorized_admin?, set_authorization

Class Method Details

.inherited(subclass) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/jungle_path/app/api/base.rb', line 43

def self.inherited(subclass)
  super
  subclass.instance_eval do
    set_default_rack_middleware jungle.application.logger, false
    set_default_error_handling jungle.application.logger

    helpers JunglePath::API::Helpers::DataCache
    helpers JunglePath::API::Helpers::Logging
    #set_logger jungle.application.logger
    helpers JunglePath::API::Helpers::Result
    helpers JunglePath::API::Helpers::Auth
    helpers Server::Base::Database

# Your own:
    set_authorization jungle.route_access

    set_standard_api_get_log_file_list
    set_standard_api_get_log_file
    set_standard_api_query
  end
end