about summary refs log tree commit diff
path: root/server/file.go
blob: cdaef229393a47804ef891701bc3fe11bf120b2e (plain)
1
2
3
4
5
6
7
8
9
10
11
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)
	})
}