21 lines
524 B
Go
Executable File
21 lines
524 B
Go
Executable File
package websocket
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/gorilla/websocket"
|
|
)
|
|
|
|
func OpenWebsocketServer(s Server) {
|
|
s.Upgrader = &websocket.Upgrader{
|
|
CheckOrigin: func(r *http.Request) bool { return true },
|
|
}
|
|
|
|
http.HandleFunc("/ports", s.ports)
|
|
http.HandleFunc("/exerciseIds", s.exerciseIds)
|
|
http.HandleFunc("/partyData", s.partyData)
|
|
http.HandleFunc("/participantHandler", s.participantHandler)
|
|
log.Fatal("Websocket Server - Error while serving websockt server:", http.ListenAndServe("localhost:6969", nil))
|
|
}
|