File Download

This recipe will help you to setup a static file handler in your application.

First you need an amber project generated with Amber CLI or from scratch.

config/application.cr
```ruby Amber::Server.configure do |app| # All static content will run these transformations pipeline :static do plug Amber::Pipe::PoweredByAmber.new plug Amber::Pipe::Error.new plug Amber::Pipe::Static.new("./public") end

routes :static do get "/*", Amber::Controller::Static, :index end end

</div>


Also see [pipelines](/docs/guides/routing/pipelines).

<div class="hint hint-success"><p>This code is already included on projects generated by <a href="../cli/">Amber CLI</a></p>
</div>