ref: 7fa8b48d8ee308ed95106f66d9376a79942c0080
dir: /select-handler/
#!/bin/rc
rfork n
skel=$rc_gemd_dir^/skel
fs_root=/lib/gem
bind $fs_root $skel^/pages
bind /bin $skel^/bin
bind /rc $skel^/rc
bind -c '#e' $skel^/env
bind $skel /
fs_root=/pages
if(~ $location /)
location=/index.gem
if(~ $location /search){
. $rc_gemd_dir/handlers/require-input 'Input a search query'
echo 20^' '^'text/gemini'^$cr
sq=`{echo $query | urlencode -d}
ls $fs_root | grep $"sq | sed '
s,^'$fs_root'/,,g
s,^,=> ,g'
exit
}
exec serve-static