package main import ( "context" "log" "os" sr "tildegit.org/tjp/sliderule" "tildegit.org/tjp/sliderule/contrib/cgi" "tildegit.org/tjp/sliderule/contrib/fs" "tildegit.org/tjp/sliderule/gopher" "tildegit.org/tjp/sliderule/logging" ) func main() { fileSystem := os.DirFS(".") handler := sr.FallthroughHandler( fs.GopherDirectoryDefault(fileSystem, "index.gophermap"), fs.GopherDirectoryListing(fileSystem, nil), cgi.GopherCGIDirectory("/cgi-bin", "./cgi-bin"), fs.GopherFileHandler(fileSystem), ) _, infoLog, _, errLog := logging.DefaultLoggers() handler = logging.LogRequests(infoLog)(handler) server, err := gopher.NewServer(context.Background(), "localhost", "tcp4", ":70", handler, errLog) if err != nil { log.Fatal(err) } server.Serve() }