feat: add basic websocket

This commit is contained in:
trafficlunar 2024-11-27 21:00:16 +00:00
parent 404b9a937e
commit 47b757769a
2 changed files with 38 additions and 0 deletions

View file

@ -38,9 +38,12 @@ func NewRouter() {
r.Get("/visit-counter", handler.HandleGetVisitCounter)
r.With(httprate.LimitByRealIP(1, time.Hour)).Patch("/visit-counter", handler.HandlePatchVisitCounter)
r.Get("/currently-playing", handler.HandleGetCurrentlyPlaying)
r.Get("/status", handler.HandleGetStatus)
r.Get("/ws/computer", handler.HandleComputerWebsocket)
port := os.Getenv("PORT")
if len(port) == 0 {
port = "8080"