Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created August 28, 2022 08:34
Show Gist options
  • Save percybolmer/80fc7f3cc606e7636b01d4db2c72c34f to your computer and use it in GitHub Desktop.
Save percybolmer/80fc7f3cc606e7636b01d4db2c72c34f to your computer and use it in GitHub Desktop.
// setupAPI will start all Routes and their Handlers
func setupAPI() {
// Create a Manager instance used to handle WebSocket Connections
manager := NewManager()
// Serve the ./frontend directory at Route /
http.Handle("/", http.FileServer(http.Dir("./frontend")))
http.HandleFunc("/ws", manager.serveWS)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment