Handbook
Glossary
zim-responder
Vocabulary
zim
.
server
Definition
IN:
zim.server
TUPLE:
zim-responder
zim
;
Methods
USING:
accessors
combinators.short-circuit
http.server
http.server.responses
io.encodings.binary
kernel
math
sequences
zim
zim.server
;
M:
zim-responder
call-responder*
[
dup
{
[
length
1
>
]
[
first
length
1
=
]
}
1&&
[
unclip-slice
first
]
[
f
]
if
swap
"/"
join
dup
{
""
"index.htm"
"index.html"
"main.htm"
"main.html"
}
member?
[
drop
f
]
when
]
[
zim>>
[
over
[
read-entry-url
]
[
2nip
read-main-page
]
if
]
with-zim
]
bi*
2dup
and
[
<content>
binary
>>content-encoding
]
[
2drop
<404>
]
if
;