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?
There is a gem "sinatra-index" to solve this problem.
https://github.com/elitheeli/sinatra-index
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With