Skip to content

Instantly share code, notes, and snippets.

@rgaidot
Created February 16, 2014 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgaidot/9028822 to your computer and use it in GitHub Desktop.
Save rgaidot/9028822 to your computer and use it in GitHub Desktop.
Ruby on Rails Lightweight
require "rails"
require "action_controller/railtie"
class RoRLightweight < Rails::Application
routes.append do
get "/welcome" => "welcome#index"
end
config.cache_classes = true
config.middleware.delete "Rack::Lock"
config.middleware.delete "ActionDispatch::Flash"
config.middleware.delete "ActionDispatch::BestStandardsSupport"
config.secret_token = "1542f8fae401d3ec3a736b10e2cb11ec6a7ad0da11dfe7d94a453b4579184fd7aefe1f0500bdb74f5bfdb8b062163b83abed94c53b901a4a0219458f8f47fce6"
end
class WelcomeController < ActionController::Metal
include ActionController::Rendering
def index
render :text => "Hello world!"
end
end
RoRLightweight.initialize!
run RoRLightweight
source :rubygems
gem "actionpack", "~> 4.0"
gem "railties", "~> 4.0"
gem "tzinfo"
gem "thin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment