Skip to content

Commit

Permalink
Add a warning on server:start to warn about NOT using the web server …
Browse files Browse the repository at this point in the history
…in production
  • Loading branch information
fabpot committed Feb 5, 2022
1 parent cca92a7 commit 3074bcd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions commands/local_server_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,14 @@ import (
"golang.org/x/sync/errgroup"
)

var localWebServerProdWarningMsg = "The local web server is optimized for local development and MUST never be used in a production setup."

var localServerStartCmd = &console.Command{
Category: "local",
Name: "server:start",
Aliases: []*console.Alias{{Name: "server:start"}, {Name: "serve"}},
Usage: "Run a local web server",
Category: "local",
Name: "server:start",
Aliases: []*console.Alias{{Name: "server:start"}, {Name: "serve"}},
Usage: "Run a local web server",
Description: localWebServerProdWarningMsg,
Flags: []console.Flag{
dirFlag,
&console.BoolFlag{Name: "allow-http", Usage: "Prevent auto-redirection from HTTP to HTTPS"},
Expand Down Expand Up @@ -280,6 +283,7 @@ var localServerStartCmd = &console.Command{
}

reexec.NotifyForeground("listening")
ui.Warning(localWebServerProdWarningMsg)
ui.Success(msg)
}

Expand Down

0 comments on commit 3074bcd

Please sign in to comment.