Bind port to env var
This commit is contained in:
parent
f5c2b1952a
commit
caf32c1c3a
@ -2,6 +2,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/averagemarcus/gopherss/internal/server"
|
||||
)
|
||||
@ -20,6 +21,7 @@ var serverCmd = &cobra.Command{
|
||||
|
||||
func init() {
|
||||
serverCmd.Flags().StringVarP(&port, "port", "p", "8080", "The port to run the web server on")
|
||||
viper.BindPFlag("PORT", refreshCmd.Flags().Lookup("port"))
|
||||
|
||||
rootCmd.AddCommand(serverCmd)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user