aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2024-10-08 11:15:35 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2024-10-08 11:15:35 -0400
commitcb30fbbf8a1d5680595ed3841ef75cebad433ca1 (patch)
tree336073dd0a45cdd672cd6cea3ec601e6828f5acf
parent663baf92df7babdf3d1a587594d6301cc5c139ad (diff)
Remove static and site status endpoints
Since this backend will only ever be deployed on the same machine as the site, the site status endpoint is superfluous. Serving static files falls outside of the roles fo this backend, it is better performed by a service with caching features like NGINX.
-rw-r--r--api/api.go11
-rw-r--r--nonsense-time.go3
2 files changed, 0 insertions, 14 deletions
diff --git a/api/api.go b/api/api.go
index 251b647..eb801eb 100644
--- a/api/api.go
+++ b/api/api.go
@@ -93,17 +93,6 @@ func VttLogs(w http.ResponseWriter, req *http.Request) {
}
}
-func SiteOnline(w http.ResponseWriter, req *http.Request) {
- const URL string = "https://dnd.jpappel.xyz"
-
- status := remoteOnline(req.Context(), URL)
- if !status.Online {
- Logger.DebugContext(req.Context(), "Campaign Website is offline")
- }
-
- respondOnline(w, status)
-}
-
func init() {
Logger = slog.New(slog.NewTextHandler(os.Stdout, nil))
}
diff --git a/nonsense-time.go b/nonsense-time.go
index 3ffff11..2a8debc 100644
--- a/nonsense-time.go
+++ b/nonsense-time.go
@@ -63,13 +63,10 @@ func main() {
dashboard.Logger = logger
vtt := timeoutMiddleware(http.HandlerFunc(api.VttOnline), *waitTime)
- site := timeoutMiddleware(http.HandlerFunc(api.SiteOnline), *waitTime)
mux.Handle("GET /vtt/status", vtt)
mux.HandleFunc("GET /vtt", api.VttRedirect)
- mux.Handle("GET /site/status", site)
mux.HandleFunc("GET /", dashboard.Index)
- mux.HandleFunc("GET /static/", dashboard.StaticHandler)
mux.HandleFunc("GET /vtt/logs", api.VttLogs)
logger.Info(fmt.Sprint("Listening on ", addr))