Sha256: 3ace48b03a7f4eb955baa6e9ac07e05929a3d70017838c363863e0ab8f678f15
Contents?: true
Size: 722 Bytes
Versions: 4
Compression:
Stored size: 722 Bytes
Contents
## MYAPP.rb ## Simple example app of how to use the Sinatra::Cache plugin in a new 'Sub-Classed' Sinatra app ## that inherits from Sinatra::Base require "rubygems" require "sinatra/base" require 'sinatra/cache' class MyApp < Sinatra::Base register Sinatra::Cache enable :logging enable :static set :public, "#{File.dirname(__FILE__)}/public" set :views, "#{File.dirname(__FILE__)}/views" get '/' do erb(:index) end get '/cache' do cache("Hello World from Sinatra Version=[#{Sinatra::VERSION}]") end # YES, I know this is NOT ideal, but it's only a test ;-) get '/cache_expire' do cache_expire("/cache") end end MyApp.run!(:port => 4568) if __FILE__ == $0 #/EOF
Version data entries
4 entries across 4 versions & 3 rubygems