From 93376705dcf8d368f3fb099c620808735071de73 Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Sat, 19 Oct 2024 12:05:10 +0200 Subject: [PATCH] feat: (re)add GoTomato.go - refactor server package - update package name - rename `StartServer()` to `Start()` - (re)add `GoTomato.go` to call `server.Start()` - update README --- GoTomato.go | 9 +++++++++ README.md | 2 +- cmd/server/main.go | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 GoTomato.go 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")