2020-01-13 17:05:53 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Controller for the application status, useful for debugging
|
|
|
|
class HealthController < ActionController::Base
|
|
|
|
respond_to :json
|
|
|
|
|
|
|
|
def status
|
2020-01-14 14:33:00 +01:00
|
|
|
require 'version'
|
|
|
|
|
2020-01-13 17:05:53 +01:00
|
|
|
render json: {
|
2020-02-26 10:19:43 +01:00
|
|
|
name: 'Fab-manager',
|
2020-01-13 17:05:53 +01:00
|
|
|
status: 'running',
|
|
|
|
dependencies: {
|
|
|
|
postgresql: HealthService.database?,
|
|
|
|
redis: HealthService.redis?,
|
|
|
|
elasticsearch: HealthService.elasticsearch?
|
|
|
|
},
|
2020-01-14 14:33:00 +01:00
|
|
|
up_to_date: {
|
|
|
|
migrations: HealthService.migrations?,
|
|
|
|
version: Version.up_to_date?
|
|
|
|
},
|
|
|
|
stats: HealthService.stats,
|
2020-05-18 17:10:04 +02:00
|
|
|
tagline: 'The platform to manage your fablab or your coworking space.',
|
|
|
|
url: 'https://www.fab-manager.com'
|
2020-01-13 17:05:53 +01:00
|
|
|
}
|
|
|
|
end
|
2020-01-14 14:33:00 +01:00
|
|
|
end
|