FCGI display - part-cw/lambdanative GitHub Wiki

(FCGI-display string)

Sends the string to the connected web client. Note that calls that use the standard output port will write to the web server log, not the connected client.

Parameter Description
string String to be sent to 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))