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:
parent
c59f737eb7
commit
b7a79acdb0
3 changed files with 12 additions and 3 deletions
9
GoTomato.go
Normal file
9
GoTomato.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"git.smsvc.net/pomodoro/GoTomato/cmd/server"
|
||||
)
|
||||
|
||||
func main() {
|
||||
server.Start()
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue