Module: Rodbot::Rack
- Defined in:
- lib/rodbot/rack.rb
Class Method Summary collapse
-
.boot(rack) ⇒ Object
Default
config.ru
. -
.request(path, params: {}, timeout: 10) ⇒ HTTPX::Response
Send request to the app service.
Class Method Details
.boot(rack) ⇒ Object
Default config.ru
In case you wish to do things differently, just copy the contents of this method into your config.ru
file and tweak it.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rodbot/rack.rb', line 16 def boot(rack) loader = Zeitwerk::Loader.new loader.logger = Rodbot::Log.logger('loader') loader.push_dir(Rodbot.env.root.join('lib')) loader.push_dir(Rodbot.env.root.join('app')) if Rodbot.env.development? || Rodbot.env.test? loader.enable_reloading loader.setup rack.run ->(env) do loader.reload App.call(env) end else loader.setup Zeitwerk::Loader.eager_load_all rack.run App.freeze.app end end |