feat(server): restructure Pomodoro server into modular components
- move server logic to cmd/server/main.go
- create packages for websocket, pomodoro and broadcast handling
- define models for messages
- remove old GoTomato.go file
- update README
🤖
This commit is contained in:
parent
6d73711341
commit
c59f737eb7
10 changed files with 224 additions and 157 deletions
17
cmd/server/main.go
Normal file
17
cmd/server/main.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"git.smsvc.net/pomodoro/GoTomato/internal/websocket"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/ws", websocket.HandleConnections)
|
||||
|
||||
log.Println("Pomodoro WebSocket server started on :8080")
|
||||
err := http.ListenAndServe(":8080", nil)
|
||||
if err != nil {
|
||||
log.Fatalf("Error starting server: %v", err)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue