Class: Mints::PublicAPIController

Inherits:
ActionController::API
  • Object
show all
Includes:
ReverseProxy::Controller
Defined in:
lib/mints/controllers/public_api_controller.rb

Direct Known Subclasses

Api::V1::MintsPublicController

Instance Method Summary collapse

Instance Method Details

#indexObject

[View source]

7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/mints/controllers/public_api_controller.rb', line 7

def index
    headers = {
        'host' => "#{@host.gsub('http://', '').gsub('https://', '')}",
        'ApiKey' => "#{@api_key}", 
        'Content-Type'=> 'application/json', 
        'Accept'=> 'application/json' 
    }
    reverse_proxy "#{@host}", headers: headers, verify_ssl: false do |config|
        # We got a 404!
        config.on_missing do |code, response|
            raise ActionController::RoutingError.new('Not Found')
        end
    end
end