summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/cgi/main.go2
-rw-r--r--examples/fileserver/main.go8
-rw-r--r--examples/gopher_fileserver/main.go6
3 files changed, 7 insertions, 9 deletions
diff --git a/examples/cgi/main.go b/examples/cgi/main.go
index a582c9e..4d48422 100644
--- a/examples/cgi/main.go
+++ b/examples/cgi/main.go
@@ -23,7 +23,7 @@ func main() {
}
// make use of a CGI request handler
- cgiHandler := cgi.GeminiCGIDirectory("/cgi-bin", "./cgi-bin")
+ cgiHandler := cgi.GeminiCGIDirectory("./cgi-bin", "/cgi-bin")
_, infoLog, _, errLog := logging.DefaultLoggers()
diff --git a/examples/fileserver/main.go b/examples/fileserver/main.go
index c374cc4..e90fdd9 100644
--- a/examples/fileserver/main.go
+++ b/examples/fileserver/main.go
@@ -21,16 +21,14 @@ func main() {
log.Fatal(err)
}
- // build the request handler
- fileSystem := os.DirFS(".")
// Fallthrough tries each handler in succession until it gets something other than "51 Not Found"
handler := sr.FallthroughHandler(
// first see if they're fetching a directory and we have <dir>/index.gmi
- fs.GeminiDirectoryDefault(fileSystem, "index.gmi"),
+ fs.GeminiDirectoryDefault(".", "", "index.gmi"),
// next (still if they requested a directory) build a directory listing response
- fs.GeminiDirectoryListing(fileSystem, nil),
+ fs.GeminiDirectoryListing(".", "", nil),
// finally, try to find a file at the request path and respond with that
- fs.GeminiFileHandler(fileSystem),
+ fs.GeminiFileHandler(".", ""),
)
router := &sr.Router{}
diff --git a/examples/gopher_fileserver/main.go b/examples/gopher_fileserver/main.go
index 057aa21..1cb7495 100644
--- a/examples/gopher_fileserver/main.go
+++ b/examples/gopher_fileserver/main.go
@@ -13,10 +13,10 @@ import (
func main() {
handler := sr.FallthroughHandler(
- fs.GopherDirectoryDefault(".", nil),
- fs.GopherDirectoryListing(".", nil),
+ fs.GopherDirectoryDefault(".", "", nil),
+ fs.GopherDirectoryListing(".", "", nil),
cgi.GopherCGIDirectory("/cgi-bin", "./cgi-bin", nil),
- fs.GopherFileHandler(".", nil),
+ fs.GopherFileHandler(".", "", nil),
)
_, infoLog, _, errLog := logging.DefaultLoggers()