Created
June 23, 2022 15:16
-
-
Save aaripurna/28ee6c08ee119531b8ca269d30f4c0c7 to your computer and use it in GitHub Desktop.
This file contains 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
require "our_app" | |
require "we_can_use_our_middleware" | |
Rails.application.routes.draw do | |
# we can mount directly | |
mount OurNewApp => "/posts" | |
# using Rack::Builder to add middleware | |
mount Rack::Builder.new { | |
use ApiKeyValidationMiddleware | |
run OurNewApp | |
}, to: "/secure_posts" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment