diff --git a/examples/counter/cmd/main.go b/examples/counter/cmd/main.go index 5d0aafa..4866b15 100644 --- a/examples/counter/cmd/main.go +++ b/examples/counter/cmd/main.go @@ -8,6 +8,9 @@ // Flags / environment: // // PORT listen port (default 8080) +// LVT_DEV_MODE=true alias for --dev (set by e2etest.StartTestServer so the +// subprocess inherits dev-mode without needing to pass +// flags through the test harness) // --dev relax origin checks for localhost development (so the // WebSocket upgrader accepts requests from arbitrary // localhost ports); the production allowlist applies when @@ -35,7 +38,7 @@ func main() { } var opts []livetemplate.Option - if *dev { + if *dev || os.Getenv("LVT_DEV_MODE") == "true" { opts = append(opts, livetemplate.WithDevMode(true), livetemplate.WithPermissiveOriginCheck(), diff --git a/examples/login/cmd/main.go b/examples/login/cmd/main.go index e694e00..40efa22 100644 --- a/examples/login/cmd/main.go +++ b/examples/login/cmd/main.go @@ -12,6 +12,9 @@ // Flags / environment: // // PORT listen port (default 8080) +// LVT_DEV_MODE=true alias for --dev (set by e2etest.StartTestServer so the +// subprocess inherits dev-mode without needing to pass +// flags through the test harness) // MOUNT_PATH mount path (default "/") // --dev relax origin checks for localhost development and enable // livetemplate's DevMode. Production allowlist applies when @@ -48,7 +51,7 @@ func main() { } var opts []livetemplate.Option - if *dev { + if *dev || os.Getenv("LVT_DEV_MODE") == "true" { opts = append(opts, livetemplate.WithDevMode(true), livetemplate.WithPermissiveOriginCheck(), diff --git a/examples/patterns/cmd/main.go b/examples/patterns/cmd/main.go index 755a63a..2a44f59 100644 --- a/examples/patterns/cmd/main.go +++ b/examples/patterns/cmd/main.go @@ -17,6 +17,9 @@ // Flags / environment: // // PORT listen port (default 8080) +// LVT_DEV_MODE=true alias for --dev (set by e2etest.StartTestServer so the +// subprocess inherits dev-mode without needing to pass +// flags through the test harness) // --dev relax origin checks for localhost development and enable // livetemplate's DevMode (verbose logging tests capture). // The production allowlist applies when absent. @@ -43,7 +46,7 @@ func main() { } var opts []livetemplate.Option - if *dev { + if *dev || os.Getenv("LVT_DEV_MODE") == "true" { opts = append(opts, livetemplate.WithDevMode(true), livetemplate.WithPermissiveOriginCheck(), diff --git a/examples/progressive-enhancement/cmd/main.go b/examples/progressive-enhancement/cmd/main.go index 8177c8b..2d7660d 100644 --- a/examples/progressive-enhancement/cmd/main.go +++ b/examples/progressive-enhancement/cmd/main.go @@ -21,6 +21,9 @@ // Flags / environment: // // PORT listen port (default 8080) +// LVT_DEV_MODE=true alias for --dev (set by e2etest.StartTestServer so the +// subprocess inherits dev-mode without needing to pass +// flags through the test harness) // --dev relax origin checks for localhost development and enable // livetemplate's DevMode (verbose logging tests capture). // The production allowlist applies when absent. @@ -47,7 +50,7 @@ func main() { } var baseOpts []livetemplate.Option - if *dev { + if *dev || os.Getenv("LVT_DEV_MODE") == "true" { baseOpts = append(baseOpts, livetemplate.WithDevMode(true), livetemplate.WithPermissiveOriginCheck(), diff --git a/examples/shared-notepad/cmd/main.go b/examples/shared-notepad/cmd/main.go index a88de37..bfdf1ed 100644 --- a/examples/shared-notepad/cmd/main.go +++ b/examples/shared-notepad/cmd/main.go @@ -10,6 +10,9 @@ // Flags / environment: // // PORT listen port (default 8080) +// LVT_DEV_MODE=true alias for --dev (set by e2etest.StartTestServer so the +// subprocess inherits dev-mode without needing to pass +// flags through the test harness) // --dev relax origin checks for localhost development and enable // livetemplate's DevMode. Production allowlist applies when // absent. @@ -38,7 +41,7 @@ func main() { opts := []livetemplate.Option{ livetemplate.WithAuthenticator(notepad.NewDemoBasicAuth()), } - if *dev { + if *dev || os.Getenv("LVT_DEV_MODE") == "true" { opts = append(opts, livetemplate.WithDevMode(true), livetemplate.WithPermissiveOriginCheck(), diff --git a/examples/todos/cmd/main.go b/examples/todos/cmd/main.go index 5ea5786..187b24f 100644 --- a/examples/todos/cmd/main.go +++ b/examples/todos/cmd/main.go @@ -12,6 +12,9 @@ // Flags / environment: // // PORT listen port (default 8080) +// LVT_DEV_MODE=true alias for --dev (set by e2etest.StartTestServer so the +// subprocess inherits dev-mode without needing to pass +// flags through the test harness) // --dev relax origin checks for localhost development and enable // livetemplate's DevMode (verbose logging the e2e framework // captures). The production allowlist applies when absent. @@ -38,7 +41,7 @@ func main() { } var opts []livetemplate.Option - if *dev { + if *dev || os.Getenv("LVT_DEV_MODE") == "true" { opts = append(opts, livetemplate.WithDevMode(true), livetemplate.WithPermissiveOriginCheck(),