Compare commits
2 commits
fe49601b30
...
e8e65c4f3a
Author | SHA1 | Date | |
---|---|---|---|
e8e65c4f3a | |||
256837c130 |
2 changed files with 9 additions and 2 deletions
|
@ -24,6 +24,13 @@ var (
|
||||||
|
|
||||||
// Start the pomodoro server
|
// Start the pomodoro server
|
||||||
func Start() {
|
func Start() {
|
||||||
|
// Update usage output
|
||||||
|
flag.Usage = func() {
|
||||||
|
fmt.Fprintf(flag.CommandLine.Output(), "Usage of %s:\n", "GoTomato")
|
||||||
|
flag.PrintDefaults()
|
||||||
|
fmt.Println("\nPoint your client to 'ws://<listenAddress>:<listenPort>'")
|
||||||
|
}
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
// show server and protocl version and exit
|
// show server and protocl version and exit
|
||||||
|
@ -45,7 +52,7 @@ func Start() {
|
||||||
|
|
||||||
// start connection handler and broadcast
|
// start connection handler and broadcast
|
||||||
r := http.NewServeMux()
|
r := http.NewServeMux()
|
||||||
r.HandleFunc("/ws", websocket.HandleConnection)
|
r.HandleFunc("/", websocket.HandleConnection)
|
||||||
go websocket.SendPermanentBroadCastMessage()
|
go websocket.SendPermanentBroadCastMessage()
|
||||||
|
|
||||||
helper.Logger.Info("GoTomato started", "version", metadata.GoTomatoVersion)
|
helper.Logger.Info("GoTomato started", "version", metadata.GoTomatoVersion)
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
<button id="resetButton" style="display: none;">Reset</button>
|
<button id="resetButton" style="display: none;">Reset</button>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var ws = new WebSocket("ws://localhost:8080/ws");
|
var ws = new WebSocket("ws://localhost:8080");
|
||||||
var isPaused = false; // Track if the timer is paused
|
var isPaused = false; // Track if the timer is paused
|
||||||
|
|
||||||
ws.onopen = function () {
|
ws.onopen = function () {
|
||||||
|
|
Loading…
Reference in a new issue