user no stays in cache forever, fix some hubs bugs and add new enpoints

This commit is contained in:
2026-05-04 14:03:02 +02:00
parent 22e2d18810
commit 015c79bf09
14 changed files with 260 additions and 34 deletions
+5 -1
View File
@@ -69,6 +69,10 @@ func main() {
http.HandleFunc("PUT /hub/join", withCORS(httpRequest.HandleHubJoin))
http.HandleFunc("PATCH /hub/name", withCORS(httpRequest.HandleHubSetName))
http.HandleFunc("PATCH /hub/color", withCORS(httpRequest.HandleHubSetColor))
http.HandleFunc("PATCH /hub/icon", withCORS(httpRequest.HandleHubSetIcon))
http.HandleFunc("GET /hub/icon", withCORS(httpRequest.HandleGetHubIcon))
http.HandleFunc("PATCH /hub/bg", withCORS(httpRequest.HandleHubSetBg))
http.HandleFunc("GET /hub/bg", withCORS(httpRequest.HandleGetHubBg))
http.HandleFunc("DELETE /hub", withCORS(httpRequest.HandleHubRemove))
http.HandleFunc("PATCH /hub/usercolorallowed", withCORS(httpRequest.HandleHubToggleUserColorAllowed))
http.HandleFunc("DELETE /hub/user", withCORS(httpRequest.HandleHubUserRemove))
@@ -93,7 +97,7 @@ func main() {
http.HandleFunc("POST /connection/message", withCORS(httpRequest.HandleDm))
http.HandleFunc("GET /ws", wsServer.ServeWsConnection)
http.Handle("GET /client/", http.StripPrefix("/client/", http.FileServer(http.Dir("machine-client"))))
http.Handle("GET /client/", http.StripPrefix("/client/", http.FileServer(http.Dir("test-client"))))
log.Println("beep boop; server server started")
log.Fatal(http.ListenAndServe(":"+strconv.Itoa(int(config.Port)), nil))