Add full monorepo: virtual-banker, backend, frontend, docs, scripts, deployment
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
29
backend/api/websocket/cmd/main.go
Normal file
29
backend/api/websocket/cmd/main.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/explorer/backend/api/websocket"
|
||||
)
|
||||
|
||||
func main() {
|
||||
server := websocket.NewServer()
|
||||
|
||||
go server.Start()
|
||||
|
||||
http.HandleFunc("/ws", server.HandleWebSocket)
|
||||
|
||||
port := 8081
|
||||
if envPort := os.Getenv("WS_PORT"); envPort != "" {
|
||||
if p, err := strconv.Atoi(envPort); err == nil {
|
||||
port = p
|
||||
}
|
||||
}
|
||||
|
||||
log.Printf("Starting WebSocket server on :%d", port)
|
||||
log.Fatal(http.ListenAndServe(":"+strconv.Itoa(port), nil))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user