Paste: Hello world

Author: Lorca
Mode: factor
Date: Fri, 26 Oct 2012 21:01:49
Plain Text |
USING: kernel namespaces io.servers
http.server http.server.dispatchers http.server.responses ;
IN: http-unzip

: <main-page-action> ( -- trivial-responder ) 
    200 "Hello World!" <trivial-response> <trivial-responder> ;

: set-main-responder ( -- ) 
    <dispatcher>
        <main-page-action> "" add-responder
    main-responder set-global ;

: run-http-unzip ( -- )
    set-main-responder
    8080 httpd wait-for-server ;

MAIN: run-http-unzip

New Annotation

Summary:
Author:
Mode:
Body: