Skip to content

Instantly share code, notes, and snippets.

@aaripurna
Created June 23, 2022 15:16
Show Gist options
  • Save aaripurna/28ee6c08ee119531b8ca269d30f4c0c7 to your computer and use it in GitHub Desktop.
Save aaripurna/28ee6c08ee119531b8ca269d30f4c0c7 to your computer and use it in GitHub Desktop.
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