h2o.conf 433 B

12345678910111213141516
  1. listen: 8080
  2. max-connections: 65536
  3. error-log: /proc/self/fd/2
  4. hosts:
  5. "0.0.0.0":
  6. paths:
  7. "/json":
  8. mruby.handler: |
  9. Proc.new do |env|
  10. [200, {'content-type' => 'application/json'}, [{:message => "Hello, World!"}.to_json]]
  11. end
  12. "/plaintext":
  13. mruby.handler: |
  14. Proc.new do |env|
  15. [200, {'content-type' => 'text/plain'}, ["Hello, World!"]]
  16. end