From 8a06805fe6f076e1744f0f2b1cbc6206ccf783b7 Mon Sep 17 00:00:00 2001 From: crc Date: Sun, 19 Nov 2017 21:09:35 +0000 Subject: [PATCH] glossary: http now seving an index successfully FossilOrigin-Name: 95f5311a827b4f7ad45c05033da73de3a20ac31ff754178fd13b443cc73175ef --- glossary.forth | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/glossary.forth b/glossary.forth index ecab478..3842dcd 100755 --- a/glossary.forth +++ b/glossary.forth @@ -424,7 +424,13 @@ selector). GOPHER-PORT field:name dup '0%s\tdesc_%s\tforthworks.com\t%n\n s:with-format puts ; :gopher:list-words (-) - 'words.tsv [ s:keep !SourceLine display-entry ] file:for-each-line ; + 'words.tsv [ s:keep !SourceLine display-entry ] file:for-each-line ; + +:display-entry (-) + field:name over '%s
s:with-format puts ; + +:http:list-words (-) + #0 'words.tsv [ s:keep !SourceLine display-entry n:inc ] file:for-each-line drop ; ~~~ Next, words to display a specific word. @@ -453,7 +459,7 @@ And then the actual top level server. &Selector gets &Selector #0 #5 s:substr '/desc [ &Selector ASCII:SPACE s:tokenize #1 set:nth fetch s:chop s:keep !Target gopher:display ] s:case - 'GET_/ [ 'HTTP/1.0_200_OK\nContent-Type:_text/plain\n\nHTTP! s:with-format puts ] s:case + 'GET_/ [ 'HTTP/1.0_200_OK\nContent-Type:_text/html\n\n s:with-format puts http:list-words ] s:case drop gopher:list-words ; ~~~