Last active
September 19, 2017 03:57
-
-
Save osiro/46ebcbe1053827b6a7adbbe02b0bf809 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /lib/custom_middleware/build_number.rb | |
module CustomMiddleware | |
class BuildNumber | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
status, headers, body = @app.call(env) | |
headers['X-Build-Number'] = Rails.configuration.build_number | |
[status, headers, body] | |
end | |
end | |
end | |
# /config/application.rb | |
config.middleware.use CustomMiddleware::BuildNumber |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment