Skip to content

Commit 4305f8b

Browse files
committed
[refactoring] Point to the UI URL, if compiled in
1 parent a781624 commit 4305f8b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cmd/ssl-game-controller/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"github.com/RoboCup-SSL/ssl-game-controller/internal/app/controller"
55
"github.com/gobuffalo/packr"
6+
"log"
67
"net/http"
78
)
89

@@ -14,6 +15,12 @@ func main() {
1415
box := packr.NewBox("../../ui/dist")
1516
http.Handle("/", http.FileServer(box))
1617

18+
if box.Has("index.html") {
19+
log.Print("UI is available at http://localhost:8081")
20+
} else {
21+
log.Print("Backend-only version started. Run the UI separately or get a binary that has the UI included")
22+
}
23+
1724
// serve the bidirectional web socket
1825
http.HandleFunc("/ws", g.ApiServer.WsHandler)
1926
http.ListenAndServe(":8081", nil)

internal/app/controller/publisher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func NewPublisher(address string) (publisher Publisher, err error) {
2929
}
3030

3131
conn.SetReadBuffer(maxDatagramSize)
32-
log.Println("Connected to", address)
32+
log.Println("Publishing to", address)
3333

3434
publisher.conn = conn
3535

0 commit comments

Comments
 (0)