2008-04-15 07:10:08 -04:00
|
|
|
! Copyright (c) 2008 Slava Pestov
|
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2008-06-02 16:00:03 -04:00
|
|
|
USING: accessors kernel namespaces
|
|
|
|
|
html.templates html.templates.chloe
|
|
|
|
|
locals
|
|
|
|
|
http.server
|
|
|
|
|
http.server.filters
|
|
|
|
|
furnace ;
|
2008-06-01 18:22:39 -04:00
|
|
|
IN: furnace.boilerplate
|
2008-04-15 07:10:08 -04:00
|
|
|
|
2008-04-26 19:56:51 -04:00
|
|
|
TUPLE: boilerplate < filter-responder template ;
|
2008-04-15 07:10:08 -04:00
|
|
|
|
2008-06-09 03:14:14 -04:00
|
|
|
: <boilerplate> ( responder -- boilerplate ) f boilerplate boa ;
|
2008-04-15 07:10:08 -04:00
|
|
|
|
2008-05-01 17:24:50 -04:00
|
|
|
M:: boilerplate call-responder* ( path responder -- )
|
|
|
|
|
path responder call-next-method
|
|
|
|
|
dup content-type>> "text/html" = [
|
|
|
|
|
clone [| body |
|
2008-06-01 18:22:39 -04:00
|
|
|
[
|
|
|
|
|
body
|
|
|
|
|
responder template>> resolve-template-path <chloe>
|
|
|
|
|
with-boilerplate
|
|
|
|
|
]
|
2008-05-01 17:24:50 -04:00
|
|
|
] change-body
|
|
|
|
|
] when ;
|