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
This commit is contained in:
Sebastian Mark 2024-10-19 12:05:10 +02:00
parent c59f737eb7
commit b7a79acdb0
3 changed files with 12 additions and 3 deletions

9
GoTomato.go Normal file
View file

@ -0,0 +1,9 @@
package main
import (
"git.smsvc.net/pomodoro/GoTomato/cmd/server"
)
func main() {
server.Start()
}

View file

@ -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 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 open http://localhost:8081

View file

@ -1,4 +1,4 @@
package main package server
import ( import (
"git.smsvc.net/pomodoro/GoTomato/internal/websocket" "git.smsvc.net/pomodoro/GoTomato/internal/websocket"
@ -6,7 +6,7 @@ import (
"net/http" "net/http"
) )
func main() { func Start() {
http.HandleFunc("/ws", websocket.HandleConnections) http.HandleFunc("/ws", websocket.HandleConnections)
log.Println("Pomodoro WebSocket server started on :8080") log.Println("Pomodoro WebSocket server started on :8080")