sfcs/server/Start.go

21 lines
479 B
Go
Raw Normal View History

2025-01-29 23:20:44 +01:00
package server
import (
"log"
"net/http"
"strconv"
)
// Start the HTTP and WebSocket server
2025-02-03 21:17:49 +01:00
func (server *Server) Start() {
// Declare ourselves up and running to the console.
log.Println("Started sudoku-funpark server")
2025-01-29 23:20:44 +01:00
// Start the http server
http.HandleFunc("/json", server.jsonDumper)
2025-01-29 23:20:44 +01:00
// Start the websocket server
http.HandleFunc("/ws", server.handleConnections)
log.Fatal(http.ListenAndServe(server.ListenAddress+":"+strconv.Itoa(server.ListenPort), nil))
2025-01-29 23:20:44 +01:00
}