app.rb 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. module HelloWorld
  2. class App < Padrino::Application
  3. register Padrino::Rendering
  4. register Padrino::Mailer
  5. register Padrino::Helpers
  6. enable :sessions
  7. ##
  8. # Caching support.
  9. #
  10. # register Padrino::Cache
  11. # enable :caching
  12. #
  13. # You can customize caching store engines:
  14. #
  15. # set :cache, Padrino::Cache::Store::Memcache.new(::Memcached.new('127.0.0.1:11211', :exception_retry_limit => 1))
  16. # set :cache, Padrino::Cache::Store::Memcache.new(::Dalli::Client.new('127.0.0.1:11211', :exception_retry_limit => 1))
  17. # set :cache, Padrino::Cache::Store::Redis.new(::Redis.new(:host => '127.0.0.1', :port => 6379, :db => 0))
  18. # set :cache, Padrino::Cache::Store::Memory.new(50)
  19. # set :cache, Padrino::Cache::Store::File.new(Padrino.root('tmp', app_name.to_s, 'cache')) # default choice
  20. #
  21. ##
  22. # Application configuration options.
  23. #
  24. # set :raise_errors, true # Raise exceptions (will stop application) (default for test)
  25. # set :dump_errors, true # Exception backtraces are written to STDERR (default for production/development)
  26. # set :show_exceptions, true # Shows a stack trace in browser (default for development)
  27. # set :logging, true # Logging in STDOUT for development and file for production (default only for development)
  28. # set :public_folder, 'foo/bar' # Location for static assets (default root/public)
  29. # set :reload, false # Reload application files (default in development)
  30. # set :default_builder, 'foo' # Set a custom form builder (default 'StandardFormBuilder')
  31. # set :locale_path, 'bar' # Set path for I18n translations (default your_apps_root_path/locale)
  32. # disable :sessions # Disabled sessions by default (enable if needed)
  33. # disable :flash # Disables sinatra-flash (enabled by default if Sinatra::Flash is defined)
  34. # layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application)
  35. #
  36. ##
  37. # You can configure for a specified environment like:
  38. #
  39. # configure :development do
  40. # set :foo, :bar
  41. # disable :asset_stamp # no asset timestamping for dev
  42. # end
  43. #
  44. ##
  45. # You can manage errors like:
  46. #
  47. # error 404 do
  48. # render 'errors/404'
  49. # end
  50. #
  51. # error 505 do
  52. # render 'errors/505'
  53. # end
  54. #
  55. end
  56. end