Add ping route

This commit is contained in:
Guillaume Lazzara 2016-06-01 15:07:27 +02:00
parent bb116a68dd
commit 16ca407542
2 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1,11 @@
class PingController < ApplicationController
def index
if (ActiveRecord::Base.connected?)
render nothing: true, status: 200, content_type: "application/json"
else
render nothing: true, status: 500, content_type: "application/json"
end
end
end

View file

@ -1,5 +1,7 @@
Rails.application.routes.draw do Rails.application.routes.draw do
get "/ping" => "ping#index", :constraints => {:ip => /127.0.0.1/}
devise_for :administrations, skip: [:password, :registrations] devise_for :administrations, skip: [:password, :registrations]
devise_for :administrateurs, controllers: { devise_for :administrateurs, controllers: {