apps.rb 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. ##
  2. # This file mounts each app in the Padrino project to a specified sub-uri.
  3. # You can mount additional applications using any of these commands below:
  4. #
  5. # Padrino.mount('blog').to('/blog')
  6. # Padrino.mount('blog', :app_class => 'BlogApp').to('/blog')
  7. # Padrino.mount('blog', :app_file => 'path/to/blog/app.rb').to('/blog')
  8. #
  9. # You can also map apps to a specified host:
  10. #
  11. # Padrino.mount('Admin').host('admin.example.org')
  12. # Padrino.mount('WebSite').host(/.*\.?example.org/)
  13. # Padrino.mount('Foo').to('/foo').host('bar.example.org')
  14. #
  15. # Note 1: Mounted apps (by default) should be placed into the project root at '/app_name'.
  16. # Note 2: If you use the host matching remember to respect the order of the rules.
  17. #
  18. # By default, this file mounts the primary app which was generated with this project.
  19. # However, the mounted app can be modified as needed:
  20. #
  21. # Padrino.mount('AppName', :app_file => 'path/to/file', :app_class => 'BlogApp').to('/')
  22. #
  23. ##
  24. # Setup global project settings for your apps. These settings are inherited by every subapp. You can
  25. # override these settings in the subapps as needed.
  26. #
  27. Padrino.configure_apps do
  28. # enable :sessions
  29. set :session_secret, 'b941cbcb2d647360c0d1fb3c54a7039ed4f71cc0b7785d2aac689cc37d7757b7'
  30. set :protection, true
  31. set :protect_from_csrf, true
  32. end
  33. # Mounts the core application for this project
  34. Padrino.mount('HelloWorld::App', :app_file => Padrino.root('app/app.rb')).to('/')