main
v4.1.2
gopkg.in/chi.v4/_examples/fileserver
Documentation
pkg.go.dev ↗FileServer =========== This example demonstrates how to serve static files from your filesystem.
Boot the server: ---------------- $ go run main.go
Client requests: ---------------- $ curl http://localhost:3333/files/ <pre> <a href="notes.txt">notes.txt</a> </pre>
$ curl http://localhost:3333/files/notes.txt Notessszzz
Functions
FileServer
func FileServer(r chi.Router, path string, root http.FileSystem)
FileServer conveniently sets up a http.FileServer handler to serve static files from a http.FileSystem.