2024-10-19 10:05:10 +00:00
|
|
|
package server
|
2024-10-19 09:47:56 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"git.smsvc.net/pomodoro/GoTomato/internal/websocket"
|
|
|
|
"log"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2024-10-19 10:05:10 +00:00
|
|
|
func Start() {
|
2024-10-19 09:47:56 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|