This works, but it was a stab in the dark. I know little Ruby.
What's the accepted way to serve a plain old file for a given resource?
get '/xyz' do
File.read 'abc.html'
end
you can use set :public
to specify the directory for your static files. Then, you can serve the file using send_file()
for example:
get '/static_file' do
send_file('my_static_file')
end
Serve it out of the ./public directory. See the Static Files section of the README and the :static and :public configuration options.
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