Initial support for a serve port flag

This commit is contained in:
Lea Anthony
2020-05-06 07:13:12 +10:00
committed by Travis McLane
parent 6da02e6b44
commit ce4fa06828
7 changed files with 58 additions and 35 deletions

View File

@@ -1,4 +1,4 @@
package renderer
package bridge
import (
"encoding/json"
@@ -14,6 +14,10 @@ import (
type messageType int
// ServePort indicates which port to serve the backend on when using
// `wails serve`
var ServePort = "34115"
const (
jsMessage messageType = iota
cssMessage
@@ -93,7 +97,7 @@ func (h *Bridge) startSession(conn *websocket.Conn) {
// Run the app in Bridge mode!
func (h *Bridge) Run() error {
h.server = &http.Server{Addr: ":34115"}
h.server = &http.Server{Addr: ":" + ServePort}
http.HandleFunc("/bridge", h.wsBridgeHandler)
h.log.Info("Bridge mode started.")

View File

@@ -1,4 +1,4 @@
package renderer
package bridge
import (
"time"