diff options
| author | Adnan Maolood <[email protected]> | 2021-02-17 09:25:44 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-02-17 09:25:44 -0500 |
| commit | 246b252fd7560f559f0f38917e43511b593bd434 (patch) | |
| tree | 0a670181f74c2bc9fffccc62f22275691ff73f6a | |
| parent | fs: Fix redirect to canonical file path (diff) | |
| download | go-gemini-246b252fd7560f559f0f38917e43511b593bd434.tar.xz go-gemini-246b252fd7560f559f0f38917e43511b593bd434.zip | |
examples/server: Use os.DirFS
| -rw-r--r-- | examples/server.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/server.go b/examples/server.go index 89703ca..7f1cc1e 100644 --- a/examples/server.go +++ b/examples/server.go @@ -8,6 +8,7 @@ import ( "crypto/tls" "crypto/x509/pkix" "log" + "os" "time" "git.sr.ht/~adnano/go-gemini" @@ -32,7 +33,7 @@ func main() { } var mux gemini.ServeMux - mux.Handle("/", gemini.FileServer(gemini.Dir("/var/www"))) + mux.Handle("/", gemini.FileServer(os.DirFS("/var/www"))) server.Handle("localhost", &mux) if err := server.ListenAndServe(); err != nil { |