shithub: rc-gemd

ref: 8b3ea55d7a984e1241b211036a42ee62392616d5
dir: /select-handler/

View raw version
#!/bin/rc
fs_root=/lib/gem
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