Remove unused eventpool package, improve logging levels, standardize websocket handling, and add HandleClose functionality.
This commit is contained in:
@@ -2,6 +2,7 @@ package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"database.orly"
|
||||
@@ -20,7 +21,11 @@ type Server struct {
|
||||
}
|
||||
|
||||
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
log.T.F("path %v header %v", r.URL, r.Header)
|
||||
log.T.C(
|
||||
func() string {
|
||||
return fmt.Sprintf("path %v header %v", r.URL, r.Header)
|
||||
},
|
||||
)
|
||||
if r.Header.Get("Upgrade") == "websocket" {
|
||||
s.HandleWebsocket(w, r)
|
||||
} else if r.Header.Get("Accept") == "application/nostr+json" {
|
||||
|
||||
Reference in New Issue
Block a user