Skip to content

Instantly share code, notes, and snippets.

@davidpelaez
Created September 2, 2015 21:10
Show Gist options
  • Save davidpelaez/63c8fed441c8fad76d7a to your computer and use it in GitHub Desktop.
Save davidpelaez/63c8fed441c8fad76d7a to your computer and use it in GitHub Desktop.
Minimal lotus app configuration for a JSON API
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