require 'hanami/helpers' require 'hanami/assets' module <%= config[:classified_app_name] %> class Application < Hanami::Application configure do ## # BASIC # # Define the root path of this application. # All paths specified in this configuration are relative to path below. # root "#{ __dir__ }/.." # Relative load paths where this application will recursively load the code. # When you add new directories, remember to add them here. # load_paths << [ 'app/controllers', 'app/views' ] # Handle exceptions with HTTP statuses (true) or don't catch them (false). # Defaults to true. # See: http://www.rubydoc.info/gems/hanami-controller/ # Exceptions_management # # handle_exceptions true ## # HTTP # # Routes definitions for this application # See: http://www.rubydoc.info/gems/hanami-router#Usage # routes 'config/routes' # URI scheme used by the routing system to generate absolute URLs # Defaults to "http" # # scheme 'https' # URI host used by the routing system to generate absolute URLs # Defaults to "localhost" # # host 'example.org' # URI port used by the routing system to generate absolute URLs # Argument: An object coercible to integer, default to 80 if the scheme is http and 443 if it's https # This SHOULD be configured only in case the application listens to that non standard ports # # port 443 # Enable cookies # Argument: boolean to toggle the feature # A Hash with options # # Options: :domain - The domain (String - nil by default, not required) # :path - Restrict cookies to a relative URI (String - nil by default) # :max_age - Cookies expiration expressed in seconds (Integer - nil by default) # :secure - Restrict cookies to secure connections # (Boolean - Automatically set on true if currently using a secure connection) # See #scheme and #ssl? # :httponly - Prevent JavaScript access (Boolean - true by default) # # cookies true # or # cookies max_age: 300 # Enable sessions # Argument: Symbol the Rack session adapter # A Hash with options # # See: http://www.rubydoc.info/gems/rack/Rack/Session/Cookie # # sessions :cookie, secret: ENV['<%= config[:upcase_app_name] %>_SESSIONS_SECRET'] # Configure Rack middleware for this application # # middleware.use Rack::Protection # Default format for the requests that don't specify an HTTP_ACCEPT header # Argument: A symbol representation of a mime type, default to :html # # default_request_format :html # Default format for responses that doesn't take into account the request format # Argument: A symbol representation of a mime type, default to :html # # default_response_format :html # HTTP Body parsers # Parse non GET responses body for a specific mime type # Argument: Symbol, which represent the format of the mime type (only `:json` is supported) # Object, the parser # # body_parsers :json ## # TEMPLATES # # The layout to be used by all views # layout :application # It will load <%= config[:classified_app_name] %>::Views::ApplicationLayout # The relative path to templates # templates 'app/templates' ## # ASSETS # assets do # JavaScript compressor # # Supported engines: # # * :builtin # * :uglifier # * :yui # * :closure # # See: http://hanamirb.org/guides/assets/compressors # # In order to skip JavaScript compression comment the following line javascript_compressor :builtin # Stylesheet compressor # # Supported engines: # # * :builtin # * :yui # * :sass # # See: http://hanamirb.org/guides/assets/compressors # # In order to skip stylesheet compression comment the following line stylesheet_compressor :builtin # Specify sources for assets # sources << [ 'app/assets' ] end ## # SECURITY # # X-Frame-Options is a HTTP header supported by modern browsers. # It determines if a web page can or cannot be included via and #