diff --git a/GoTomato.go b/GoTomato.go new file mode 100644 index 0000000..01e3a2e --- /dev/null +++ b/GoTomato.go @@ -0,0 +1,9 @@ +package main + +import ( + "git.smsvc.net/pomodoro/GoTomato/cmd/server" +) + +func main() { + server.Start() +} diff --git a/README.md b/README.md index 35d94c8..2769187 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A pomodoro server written in Go ``` docker run --rm -d --name pomodoro-client -v $PWD:/usr/share/nginx/html/ -p 8081:80 nginx -go run ./cmd/server +go run . ``` open http://localhost:8081 diff --git a/cmd/server/main.go b/cmd/server/main.go index bf89583..6470e4d 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -1,4 +1,4 @@ -package main +package server import ( "git.smsvc.net/pomodoro/GoTomato/internal/websocket" @@ -6,7 +6,7 @@ import ( "net/http" ) -func main() { +func Start() { http.HandleFunc("/ws", websocket.HandleConnections) log.Println("Pomodoro WebSocket server started on :8080")