README.md in hey_doctor-1.0.0 vs README.md in hey_doctor-1.1.0

- old
+ new

@@ -27,30 +27,33 @@ } ``` ## Installation -If you have a redis instance in you application add the following initializer to create a `Redis.current`, so it don't need to use global vars, or create a new connection each request: +* If you have a redis instance in you application add the following initializer to create a `Redis.current`, so it don't need to use global vars, or create a new connection each request: ```ruby # config/initializers/redis.rb Redis.current ||= Redis.new(url: ENV['REDIS_URL']) ``` -Add this line to your application's Gemfile: +* Add a env var `RAILS_PORT` with the current application port. +* Add this line to your application's Gemfile: + ```ruby gem 'hey_doctor' ``` -And then execute: +* And then execute: + ```bash bundle install ``` -After installing the gem just mount the HealthCheck endpoint inside config.ru: +* After installing the gem, mount the HealthCheck endpoint inside config.ru: ```ruby # config.ru # bunch of requires here @@ -61,17 +64,27 @@ end ... ``` +* The last step is to mount the engine into your application, so if the application is down the middleware will notice: + +```ruby +Rails.application.routes.draw do + mount HeyDoctor::Engine, at: '/_ah/app_health' + + ... +end +``` + ## Developing ```bash docker-compose build && docker-compose up docker-compose exec web bash -rails db:setup +bundle exec rake db:setup rubocop -A && rspec ``` Minimum coverage is set to 95%.