Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static page routing in Sinatra (Ruby)

You can serve static files with Sinatra by placing them in public/ (by default) -- I have an index.html in there at the moment, but how can I make the root point to that file without having to parse it as a template?

To be clear, I can access /index.html successfully, and I'd like to route / to be the same static file, but without redirecting. Any idea how to do this?

like image 709
JP. Avatar asked Apr 04 '10 18:04

JP.


1 Answers

There is a gem "sinatra-index" to solve this problem.

https://github.com/elitheeli/sinatra-index

like image 157
Windix Avatar answered Oct 02 '22 13:10

Windix