Skip to content

Instantly share code, notes, and snippets.

@2get
Created December 17, 2014 13:58
Show Gist options
  • Save 2get/3aa3951787928f7e71a5 to your computer and use it in GitHub Desktop.
Save 2get/3aa3951787928f7e71a5 to your computer and use it in GitHub Desktop.
The Single-File Rails Application
require 'rubygems'
require 'rails'
require 'active_support/railtie'
require 'action_dispatch/railtie'
require 'action_controller/railtie'
class SingleFile < Rails::Application
config.eager_load = true
config.cache_classes = true
config.secret_key_base = 'test'
routes.append do
root to: lambda { |env|
[200, { 'Content-Type' => 'text/plain' }, ['Hello world']]
}
end
end
SingleFile.initialize!
run Rails.application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment