rstacruz / sinatra-assetpack

Package your assets transparently in Sinatra.
http://ricostacruz.com/sinatra-assetpack/
MIT License
542 stars 96 forks source link

serve not working for custom path HTML file #160

Closed osdiab closed 10 years ago

osdiab commented 10 years ago

In my app.rb, I have:

    serve '/js', from: 'app/js'
    serve '/css', from: 'app/css'
    serve '/img', from: 'app/img'
    serve '/tmpl', from: 'app/tmpl'  # This is giving me problems

Javascript, CSS, and images are all loading fine. But the Angular HTML templates are not working.

For instance I have a file at /app/tmpl/pages/home.html that just has some simple markup, but if I issue a GET request to /tmpl/pages/home.html nothing comes back.

Full app.rb file: https://gist.github.com/osdiab/9d0f8383bb15f063bbed

Ruby 2.1.1 (MRI) Assetpack 0.3.2 Sinatra 1.4.4

Thanks for the help!

osdiab commented 10 years ago

Bump!

j15e commented 10 years ago

This issue probably exist because assetpack was not intended to serve raw files other than css/js/images at first and do not deal properly with other file types. I won't dig deeper into this, it is not really the intended use, but if someone find a fix I'll be happy to merge it.

Suggestion : why not put your templates html pages in the public folder served by rack/sinatra and skip assetpack?