Skip to content
clpetersen edited this page Oct 16, 2014 · 4 revisions

Send output to the connected web client. Note that calls that use the standard output port will go to the web server log, not the connected client.

Example

(let loop ()
  (if (>= (FCGI-Accept) 0) (begin
     (set! count (+ count 1))
     (FCGI-display "Content-type: text/html\r\n\r\n")
    (FCGI-display (with-output-to-string "" (lambda ()
      (sxml->xml `(html 
        (head (title "LambdaNative FastCGI"))
        (body (h1 "LambdaNative FastCGI")  
         "Request number " ,(number->string count)
          " running on host " (i ,(FCGI-getenv "SERVER_NAME"))
        )))
      )))
     (FCGI-Finish)
    ) (thread-sleep! 0.001))
  (loop))

Clone this wiki locally