Skip to content

Instantly share code, notes, and snippets.

@trevorturk
Last active January 9, 2019 14:49
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trevorturk/91cb43c79e71e3d23649f6d103217de7 to your computer and use it in GitHub Desktop.
Save trevorturk/91cb43c79e71e3d23649f6d103217de7 to your computer and use it in GitHub Desktop.
Single file Rails 5 app
# gem install rails
# rackup
# open http://localhost:9292/
require 'action_controller/railtie'
class HelloWorld < Rails::Application
routes.append do
root to: 'hello#world'
end
config.secret_key_base = SecureRandom.hex(30)
config.eager_load = false
config.logger = Logger.new(STDOUT)
end
class HelloController < ActionController::Base
def world
render plain: 'Hello, World!'
end
end
HelloWorld.initialize!
run HelloWorld
@vasilakisfil
Copy link

Nice! Does it include all the default middlewares?

@russellballestrini
Copy link

Very cool, I've been looking for something like this for my Programming Kata called webwords (https://github.com/russellballestrini/webwords) - I used your implementation for the Ruby version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment