Class: MintPingApi::PingsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/mint_ping_api/pings_controller.rb

Instance Method Summary collapse

Instance Method Details

#authenticateObject



15
16
17
18
19
# File 'app/controllers/mint_ping_api/pings_controller.rb', line 15

def authenticate
  authenticate_or_request_with_http_basic do |username, password|
    username == Figaro.env.MINT_API_USER && password == Figaro.env.MINT_API_PASSWORD
  end
end

#showObject



7
8
9
10
11
12
13
# File 'app/controllers/mint_ping_api/pings_controller.rb', line 7

def show
  if request.headers[Figaro.env.MINT_API_TOKEN_KEY] == Figaro.env.MINT_API_TOKEN_VALUE
    render plain: 'OK'
  else
    render nothing: true, status: :service_unavailable
  end
end