blob: e921b0b673fad9dc59aceee0937a871d8fdf9c55 [file] [log] [blame]
Philipp Schrader5562df72022-02-16 20:56:51 -08001package static
2
3// A year agnostic way to serve static http files.
4import (
5 "net/http"
6
7 "github.com/frc971/971-Robot-Code/scouting/webserver/server"
8)
9
10// Serve pages given a port, directory to serve from, and an channel to pass the errors back to the caller.
11func ServePages(scoutingServer server.ScoutingServer, directory string) {
12 // Serve the / endpoint given a folder of pages.
13 scoutingServer.Handle("/", http.FileServer(http.Dir(directory)))
14}