https flag for dev mode (#3603)

This commit is contained in:
Atterpac 2024-07-29 03:46:44 -07:00 committed by GitHub
commit 7941f00c35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,6 +17,7 @@ type DevOptions struct {
Config string `description:"The config file including path" default:"./build/devmode.config.yaml"`
VitePort int `name:"port" description:"Specify the vite dev server port"`
Secure bool `name:"s" description:"Enable HTTPS"`
}
func Dev(options *DevOptions) error {
@ -45,7 +46,11 @@ func Dev(options *DevOptions) error {
os.Setenv(wailsVitePort, strconv.Itoa(port))
// Set url of frontend dev server
os.Setenv("FRONTEND_DEVSERVER_URL", fmt.Sprintf("http://%s:%d", host, port))
if options.Secure {
os.Setenv("FRONTEND_DEVSERVER_URL", fmt.Sprintf("https://%s:%d", host, port))
} else {
os.Setenv("FRONTEND_DEVSERVER_URL", fmt.Sprintf("http://%s:%d", host, port))
}
return Watcher(&WatcherOptions{
Config: options.Config,