summaryrefslogtreecommitdiff
path: root/examples/fileserver/main.go
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-01-28 14:52:35 -0700
committertjpcc <tjp@ctrl-c.club>2023-01-28 15:01:41 -0700
commit66a1b1f39a1e1d5499b548b36d18c8daa872d7da (patch)
tree96471dbd5486ede1a908790ac23e0c55b226dfad /examples/fileserver/main.go
parenta27b879accb191b6a6c6e76a6251ed751967f73a (diff)
gopher support.
Some of the contrib packages were originally built gemini-specific and had to be refactored into generic core functionality and thin protocol-specific wrappers for each of gemini and gopher.
Diffstat (limited to 'examples/fileserver/main.go')
-rw-r--r--examples/fileserver/main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/fileserver/main.go b/examples/fileserver/main.go
index e70974f..be427a1 100644
--- a/examples/fileserver/main.go
+++ b/examples/fileserver/main.go
@@ -26,11 +26,11 @@ func main() {
// Fallthrough tries each handler in succession until it gets something other than "51 Not Found"
handler := gus.FallthroughHandler(
// first see if they're fetching a directory and we have <dir>/index.gmi
- fs.DirectoryDefault(fileSystem, "index.gmi"),
+ fs.GeminiDirectoryDefault(fileSystem, "index.gmi"),
// next (still if they requested a directory) build a directory listing response
- fs.DirectoryListing(fileSystem, nil),
+ fs.GeminiDirectoryListing(fileSystem, nil),
// finally, try to find a file at the request path and respond with that
- fs.FileHandler(fileSystem),
+ fs.GeminiFileHandler(fileSystem),
)
_, infoLog, _, errLog := logging.DefaultLoggers()
@@ -39,7 +39,7 @@ func main() {
handler = logging.LogRequests(infoLog)(handler)
// run the server
- server, err := gemini.NewServer(context.Background(), errLog, tlsconf, "tcp4", ":1965", handler)
+ server, err := gemini.NewServer(context.Background(), "localhost", "tcp4", ":1965", handler, errLog, tlsconf)
if err != nil {
log.Fatal(err)
}