Skip to content

Commit

Permalink
Document Rails installation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc committed Jun 7, 2024
1 parent fd8be7d commit f4d0044
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ Install gem:

gem install rack-brotli

Requiring `'rack/brotli'` will autoload `Rack::Brotli` module. The following example shows what a simple rackup
(`config.ru`) file might look like:
Requiring `'rack/brotli'` will autoload the `Rack::Brotli` module.

The following example shows what a simple rackup (`config.ru`) file might look like:

```ruby
require 'rack'
Expand All @@ -25,6 +26,13 @@ use Rack::Brotli # Default compression quality is 5
run theapp
```

For a Ruby on Rails application, add to your `config/application.rb`:
```ruby
config.middleware.use Rack::Deflater
# Rack::Brotli goes directly under Rack::Deflater, if Rack::Deflater is present
config.middleware.use Rack::Brotli
```

### Testing

To run the entire test suite, run
Expand Down

0 comments on commit f4d0044

Please sign in to comment.