Created
December 7, 2014 16:33
-
-
Save tyabe/21303929625223bd9c2a to your computer and use it in GitHub Desktop.
Revisions
-
tyabe created this gist
Dec 7, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ source "https://rubygems.org" gem 'sinatra', require: 'sinatra/base' gem 'padrino-cache', require: false This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ RACK_ENV = ENV['RACK_ENV'] ||= 'development' unless defined?(RACK_ENV) APP_ROOT = File.expand_path('../..', __FILE__) unless defined?(APP_ROOT) require 'bundler/setup' Bundler.require(:default, RACK_ENV) require 'padrino-core' Padrino::IGNORE_NO_RENDERING_ENGINE = true require 'padrino-cache' class App < Sinatra::Base register Padrino::Routing register Padrino::Cache enable :caching enable :logging set :protect_from_csrf, false def logger Padrino.logger end get '/', cache: true do expires 10 Time.now.to_s end end App.run!