Arc Forumnew | comments | leaders | submitlogin
1 point by akkartik 3609 days ago | link | parent

Can you elaborate? You want to call the same function on any request, and pass in the url from the request? Are you using arc 3.1 or anarki?

Edit: on anarki you get this behavior by replacing the function respond in lib/srv.arc with this code:

  (def respond (out req)
    (w/stdout out
      (prrn "HTTP/1.1 200 OK")
      (prrn "Content-Type: text/html; charset=utf-8")
      (prrn "Connection: close")
      (prrn)
      (wildcard-handler req)))

  (def wildcard-handler (req)
    (prn req!op))
This will display whatever op you request.