;; lib/dream/demos/hello.sx — the canonical Dream "Hello, World!" (hello.ml).
;; Dream.run (Dream.router [Dream.get "/" (fun _ -> Dream.html "Hello!")]).

(define
  dream-hello-app
  (dream-router
    (list
      (dream-get "/" (fn (req) (dream-html "<h1>Hello, World!</h1>")))
      (dream-get
        "/hello/:name"
        (fn
          (req)
          (dream-html (str "<h1>Hello, " (dream-param req "name") "!</h1>")))))))

;; entry point (installs the handler on the host):
;;   (dream-run dream-hello-app)
