Created
August 28, 2022 08:34
-
-
Save percybolmer/80fc7f3cc606e7636b01d4db2c72c34f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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