开发者

Serving large static files with Sinatra

开发者 https://www.devze.com 2023-01-19 04:32 出处:网络
Sinatra can serve files from a static directory with the set :publ开发者_运维知识库ic, \'your_directory\' command, but how can I replicate this in a new route?

Sinatra can serve files from a static directory with the set :publ开发者_运维知识库ic, 'your_directory' command, but how can I replicate this in a new route?

Importantly, this new route needs to respect byte ranges too! Any ideas? I feel like I should be able to leverage the already present code in the static serve part of sinatra.


I think I can just use send_file (see here) - but if anyone has any other suggestions I have open ears!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号