Next: , Previous: , Up: Hello World   [Contents]

4.4 More complex URL remapping

Try this code:

(get "/hello/:who"
  (lambda (rc)
    (format #f "<p>hello ~a</p> " (params rc "who"))))
(run #:port 8080)

Now you can try http://localhost:8080/hello/artanis in your browser.

There’re two differences:

And format is a Scheme lib function. It is similar to sprintf in C language, which outputs with a formatted pattern. The second argument #f (means FALSE) indicates that returning the result as string type rather than printing out.