2008-02-29 01:57:38 -05:00
|
|
|
! Copyright (C) 2007, 2008 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2008-03-11 04:39:09 -04:00
|
|
|
USING: io.files io.encodings.utf8 namespaces http.server
|
|
|
|
http.server.static http xmode.code2html kernel html sequences
|
2008-03-29 00:00:20 -04:00
|
|
|
accessors fry ;
|
2008-02-29 01:57:38 -05:00
|
|
|
IN: xmode.code2html.responder
|
|
|
|
|
|
|
|
: <sources> ( root -- responder )
|
|
|
|
[
|
|
|
|
drop
|
2008-03-11 04:39:09 -04:00
|
|
|
"text/html" <content> swap
|
2008-05-01 21:02:34 -04:00
|
|
|
[ "last-modified" set-header ]
|
2008-03-11 04:39:09 -04:00
|
|
|
[
|
|
|
|
'[
|
|
|
|
,
|
|
|
|
dup file-name swap utf8
|
|
|
|
<file-reader>
|
|
|
|
[ htmlize-stream ] with-html-stream
|
|
|
|
] >>body
|
|
|
|
] bi
|
2008-02-29 01:57:38 -05:00
|
|
|
] <file-responder> ;
|