api.go 811 B

12345678910111213141516171819202122
  1. package main
  2. import "net/http"
  3. func registerAPIRoutes() {
  4. // Start the web server
  5. http.Handle("/", http.FileServer(webfs))
  6. http.HandleFunc("/hid", usbKVM.HIDWebSocketHandler)
  7. http.HandleFunc("/audio", videoCapture.AudioStreamingHandler)
  8. http.HandleFunc("/stream", videoCapture.ServeVideoStream)
  9. }
  10. func registerLocalAuxRoutes() {
  11. http.HandleFunc("/aux/switchusbkvm", auxMCU.HandleSwitchUSBToKVM)
  12. http.HandleFunc("/aux/switchusbremote", auxMCU.HandleSwitchUSBToRemote)
  13. http.HandleFunc("/aux/presspower", auxMCU.HandlePressPowerButton)
  14. http.HandleFunc("/aux/releasepower", auxMCU.HandleReleasePowerButton)
  15. http.HandleFunc("/aux/pressreset", auxMCU.HandlePressResetButton)
  16. http.HandleFunc("/aux/releasereset", auxMCU.HandleReleaseResetButton)
  17. http.HandleFunc("/aux/getuuid", auxMCU.HandleGetUUID)
  18. }