Created
September 2, 2015 21:10
-
-
Save davidpelaez/63c8fed441c8fad76d7a to your computer and use it in GitHub Desktop.
Minimal lotus app configuration for a JSON API
This file contains 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 characters
require 'lotus/helpers' | |
#require_relative 'controllers/preconditions' | |
module Aloha | |
class Application < Lotus::Application | |
configure do | |
root __dir__ | |
load_paths << [ 'controllers' ] | |
default_format :html | |
body_parsers :json | |
routes 'config/routes' | |
security.x_frame_options "DENY" | |
security.content_security_policy "default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self'; style-src 'self';" | |
controller.prepare do | |
include Preconditions | |
end | |
end | |
configure :development do | |
handle_exceptions false | |
end | |
configure :test do | |
handle_exceptions false | |
end | |
configure :production do; end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment