Configure > Mruby Directives
The following are the configuration directives of the mruby handler. Please refer to Using mruby to find out how to write handlers using mruby.
- Description:
-
Upon start-up evaluates given mruby expression, and uses the returned mruby object to handle the incoming requests.
mruby.handler: | Proc.new do |env| [200, {'content-type' => 'text/plain'}, ["Hello world\n"]] end
Note that the provided expression is evaluated more than once (typically for every thread that accepts incoming connections).
- Level:
- path
- See also:
mruby.handler-file
- Description:
-
Upon start-up evaluates given mruby file, and uses the returned mruby object to handle the incoming requests.
mruby.handler-file: /path/to/my-mruby-handler.rb
Note that the provided expression is evaluated more than once (typically for every thread that accepts incoming connections).
- Level:
- path
- See also:
mruby.handler