sfcs/server/Start.go

25 lines
583 B
Go
Raw Permalink 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
// Run the agent manager
server.agentManager()
// Start the http server
http.HandleFunc("GET /json", server.jsonDumper)
http.HandleFunc("POST /addTask", server.addTask)
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
}