summaryrefslogtreecommitdiffstats
path: root/debian/vendor-h2o/srcdoc/configure/mruby_directives.mt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 21:12:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 21:12:02 +0000
commit77e50caaf2ef81cd91075cf836fed0e75718ffb4 (patch)
tree53b7b411290b63192fc9e924a3b6b65cdf67e9d0 /debian/vendor-h2o/srcdoc/configure/mruby_directives.mt
parentAdding upstream version 1.8.3. (diff)
downloaddnsdist-77e50caaf2ef81cd91075cf836fed0e75718ffb4.tar.xz
dnsdist-77e50caaf2ef81cd91075cf836fed0e75718ffb4.zip
Adding debian version 1.8.3-2.debian/1.8.3-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/vendor-h2o/srcdoc/configure/mruby_directives.mt')
-rw-r--r--debian/vendor-h2o/srcdoc/configure/mruby_directives.mt58
1 files changed, 58 insertions, 0 deletions
diff --git a/debian/vendor-h2o/srcdoc/configure/mruby_directives.mt b/debian/vendor-h2o/srcdoc/configure/mruby_directives.mt
new file mode 100644
index 0000000..e1d0e2f
--- /dev/null
+++ b/debian/vendor-h2o/srcdoc/configure/mruby_directives.mt
@@ -0,0 +1,58 @@
+? my $ctx = $main::context;
+? $_mt->wrapper_file("wrapper.mt", "Configure", "Mruby Directives")->(sub {
+
+<p>
+The following are the configuration directives of the mruby handler.
+Please refer to <a href="configure/mruby.html">Using mruby</a> to find out how to write handlers using mruby.
+</p>
+
+<?
+$ctx->{directive}->(
+ name => "mruby.handler",
+ levels => [ qw(path) ],
+ see_also => render_mt(<<'EOT'),
+<a href="configure/mruby_directives.html#mruby.handler-file"><code>mruby.handler-file</code></a>
+EOT
+ desc => <<'EOT',
+Upon start-up evaluates given mruby expression, and uses the returned mruby object to handle the incoming requests.
+EOT
+)->(sub {
+?>
+
+<?= $ctx->{example}->('Hello-world in mruby', <<'EOT')
+mruby.handler: |
+ Proc.new do |env|
+ [200, {'content-type' => 'text/plain'}, ["Hello world\n"]]
+ end
+EOT
+?>
+
+<p>
+Note that the provided expression is evaluated more than once (typically for every thread that accepts incoming connections).
+</p>
+? })
+
+<?
+$ctx->{directive}->(
+ name => "mruby.handler-file",
+ levels => [ qw(path) ],
+ see_also => render_mt(<<'EOT'),
+<a href="configure/mruby_directives.html#mruby.handler"><code>mruby.handler</code></a>
+EOT
+ desc => <<'EOT',
+Upon start-up evaluates given mruby file, and uses the returned mruby object to handle the incoming requests.
+EOT
+)->(sub {
+?>
+
+<?= $ctx->{example}->('Hello-world in mruby', <<'EOT')
+mruby.handler-file: /path/to/my-mruby-handler.rb
+EOT
+?>
+
+<p>
+Note that the provided expression is evaluated more than once (typically for every thread that accepts incoming connections).
+</p>
+? })
+
+? })