How to serve static files via Rack?

后端 未结 4 2189
Happy的楠姐
Happy的楠姐 2020-12-04 11:10

I am currently developing a Rack-based application and want to redirect all file requests(e.g. filename.filetype) to a specified folder.

Rack::Static only supports f

4条回答
  •  忘掉有多难
    2020-12-04 11:31

    An update, the latest Rack implementation allows you to use Rack::Static

    Example:

    use Rack::Static, :urls => ["/media"]
    

    Will serve all static resources under ./media folder relative to config.ru location.

提交回复
热议问题