Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make host configurable #78

Merged
merged 1 commit into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type (
// Config contains the configuration for the UI server
Config struct {
TemporalGRPCAddress string `yaml:"temporalGrpcAddress"`
Host string `yaml:"host"`
Port int `yaml:"port"`
UIRootPath string `yaml:"uiRootPath"`
Auth Auth `yaml:"auth"`
Expand Down
5 changes: 2 additions & 3 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ package server
import (
"embed"
"fmt"
"strconv"

"github.com/gorilla/securecookie"
"github.com/gorilla/sessions"
Expand Down Expand Up @@ -103,8 +102,8 @@ func NewServer(opts ...server_options.ServerOption) *Server {
// Start UI server.
func (s *Server) Start() error {
fmt.Println("Starting UI server...")
port := s.options.Config.Port
s.httpServer.Logger.Fatal(s.httpServer.Start(":" + strconv.Itoa(port)))
address := fmt.Sprintf("%s:%d", s.options.Config.Host, s.options.Config.Port)
s.httpServer.Logger.Fatal(s.httpServer.Start(address))
return nil
}

Expand Down