shithub: rc-gemd

ref: a2cdff91c941cebc075bd5b4421c6634ee15d247
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