-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
rails-metal.ru
32 lines (27 loc) · 848 Bytes
/
rails-metal.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require "securerandom"
require "action_controller/railtie"
class HelloWorld < Rails::Application
routes.append do
get "/", to: "hello#world"
end
config.api_only = true
config.cache_classes = true
config.eager_load = true
config.secret_key_base = SecureRandom.hex(64)
[Rack::Sendfile, ActionDispatch::Static,
ActionDispatch::Executor, ActiveSupport::Cache::Strategy::LocalCache::Middleware,
ActionDispatch::RequestId, ActionDispatch::RemoteIp,
Rails::Rack::Logger, ActionDispatch::ShowExceptions,
ActionDispatch::DebugExceptions, ActionDispatch::Callbacks,
Rack::ETag, Rack::Head
].each do |middleware|
config.middleware.delete(middleware)
end
end
class HelloController < ActionController::Metal
def world
self.response_body = "Hello World!"
end
end
APP = HelloWorld.initialize!(:metal)
run APP