app.rb 278 B

123456789101112131415161718192021
  1. require 'sinatra'
  2. require 'rack/cache'
  3. use Rack::Cache do
  4. set :verbose, true
  5. set :metastore, 'heap:/'
  6. set :entitystore, 'heap:/'
  7. end
  8. before do
  9. last_modified $updated_at ||= Time.now
  10. end
  11. get '/' do
  12. erb :index
  13. end
  14. put '/' do
  15. $updated_at = nil
  16. redirect '/'
  17. end