Paste: hello web app - response error

Author: _martind
Mode: factor
Date: Sat, 2 May 2009 07:48:51
Plain Text |
! FACTOR CODE
USING:
    kernel accessors
    threads namespaces
    http.server http.server.dispatchers
    furnace furnace.actions
;
IN: hello-web

TUPLE: hello-dispatcher < dispatcher ;

: <hello-action> ( -- action )
    <page-action>
        { hello-dispatcher "hello" } >>template ;

: <hello-dispatcher> ( -- responder )
    hello-dispatcher new-dispatcher
        <hello-action> "" add-responder ;

: run-hello ( -- )
    <hello-dispatcher> main-responder set-global
    [ 8080 httpd ] in-thread ;


! CHLOE TEMPLATE
<? xml version='1.0' ?>
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
    <html>
        <body>O hai!</body>
    </html>
</t:chloe>

New Annotation

Summary:
Author:
Mode:
Body: