mirror of
https://github.com/taigrr/wails.git
synced 2026-04-12 18:11:31 -07:00
Initial support for a serve port flag
This commit is contained in:
committed by
Travis McLane
parent
6da02e6b44
commit
ce4fa06828
@@ -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.")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package renderer
|
||||
package bridge
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
Reference in New Issue
Block a user