diff options
author | 2022-11-26 19:59:15 +0100 | |
---|---|---|
committer | 2022-11-26 23:51:25 +0100 | |
commit | f4ce6ac1be7b2817a8e02fc0e517d93ff9890d2e (patch) | |
tree | 9474949eb2a2f21e5276a72bd3acdb499c37b5a5 /server/file.go | |
parent | initial commit (diff) | |
download | cgit-httpd-f4ce6ac1be7b2817a8e02fc0e517d93ff9890d2e.tar.xz |
add initial version of cgit-httpd
Diffstat (limited to 'server/file.go')
-rw-r--r-- | server/file.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/file.go b/server/file.go new file mode 100644 index 0000000..cdaef22 --- /dev/null +++ b/server/file.go @@ -0,0 +1,12 @@ +// Copyright 2022 Terin Stock. +// SPDX-License-Identifier: MPL-2.0 + +package server + +import "net/http" + +func FileHandler(path string) http.Handler { + return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { + http.ServeFile(rw, req, path) + }) +} |