sfcs/server/Start.go

25 lines
583 B
Go

package server
import (
"log"
"net/http"
"strconv"
)
// Start the HTTP and WebSocket server
func (server *Server) Start() {
// Declare ourselves up and running to the console.
log.Println("Started sudoku-funpark server")
// Run the agent manager
server.agentManager()
// Start the http server
http.HandleFunc("GET /json", server.jsonDumper)
http.HandleFunc("POST /addTask", server.addTask)
// Start the websocket server
http.HandleFunc("/ws", server.handleConnections)
log.Fatal(http.ListenAndServe(server.ListenAddress+":"+strconv.Itoa(server.ListenPort), nil))
}