Create a library for serving static files
It serves files that are in a given directory, and this could be
extended to html files.
In order to validate the functionality we also added a simple
`ScoutingServer` that you can `Start()` and `Stop()`. The unit test
makes use of this. The `main` binary that ties all the components
together also makes use of this.
See the README for an overview of everything we added in this patch.
Change-Id: Id496b032d6aa70fd8502eeb347895ac52b5d1ddd
Signed-off-by: Het Satasiya <satasiyahet@gmail.com>
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
diff --git a/scouting/webserver/BUILD b/scouting/webserver/BUILD
new file mode 100644
index 0000000..ff91aa8
--- /dev/null
+++ b/scouting/webserver/BUILD
@@ -0,0 +1,20 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
+
+go_library(
+ name = "webserver_lib",
+ srcs = ["main.go"],
+ importpath = "github.com/frc971/971-Robot-Code/scouting/webserver",
+ target_compatible_with = ["@platforms//cpu:x86_64"],
+ visibility = ["//visibility:private"],
+ deps = [
+ "//scouting/webserver/server",
+ "//scouting/webserver/static",
+ ],
+)
+
+go_binary(
+ name = "webserver",
+ embed = [":webserver_lib"],
+ target_compatible_with = ["@platforms//cpu:x86_64"],
+ visibility = ["//visibility:public"],
+)