Skip to content

Commit

Permalink
Reintroduce host URL parameter
Browse files Browse the repository at this point in the history
Now with new and improved name
  • Loading branch information
stalehd committed Apr 9, 2023
1 parent 1d814dc commit 7aabbb8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions cmd/pax/cmd_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (s *serverCmd) Execute([]string) error {
GRPCListenAddr: opt.GRPCListenAddr,
SpanToken: opt.Token,
SpanCollectionID: opt.CollectionID,
TileServerURL: opt.ServerURL,
})

c := make(chan os.Signal, 2)
Expand Down
1 change: 1 addition & 0 deletions cmd/pax/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var opt struct {
GRPCListenAddr string `long:"grpc" default:":4501" description:"gRPC listen address" required:"yes"`
Token string `long:"token" env:"SPAN_API_TOKEN" description:"Span API Token" required:"yes"`
CollectionID string `long:"collection" description:"Span Collection ID for PAX counters" default:"17dlb1hl0l800a"`
ServerURL string `long:"server-url" description:"External URL for tile server" default:"http://localhost:4500" required:"yes"`
Server serverCmd `command:"server" description:"start server"`
Fetch fetchCmd `command:"fetch" description:"fetch historical data"`
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/jessevdk/go-flags v1.5.0
github.com/jmoiron/sqlx v1.3.5
github.com/lab5e/go-spanapi/v4 v4.4.1
github.com/lab5e/gotileserver v0.0.2
github.com/lab5e/gotileserver v0.0.3
github.com/stretchr/testify v1.8.2
google.golang.org/genproto v0.0.0-20230327215041-6ac7f18bb9d5
google.golang.org/grpc v1.54.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/lab5e/go-spanapi/v4 v4.4.1 h1:lADGYku+0eoZ2LSl80JqX3VMty9hqSE22I3nNso1mEM=
github.com/lab5e/go-spanapi/v4 v4.4.1/go.mod h1:lTEIqK1ApjzDBMXYe77EPeQHkxK43wYQaRWq7iQbrmU=
github.com/lab5e/gotileserver v0.0.2 h1:EnIAhryaAtIyG1s6kRpQdTz6mfsDabx2v5b0AEFUJa8=
github.com/lab5e/gotileserver v0.0.2/go.mod h1:ELcWmRsG3n1NFua7YN+qKjsIcsXpz18RiEhA0uscLJs=
github.com/lab5e/gotileserver v0.0.3 h1:7h7CnKYJh+JAbDcyaAp920uybDZBvCwydUo6+QYOTUc=
github.com/lab5e/gotileserver v0.0.3/go.mod h1:ELcWmRsG3n1NFua7YN+qKjsIcsXpz18RiEhA0uscLJs=
github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98=
Expand Down
2 changes: 1 addition & 1 deletion pkg/server/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (s *Server) startHTTP() error {

httpMux := http.NewServeMux()

gotileserver.RegisterHandler(httpMux)
gotileserver.RegisterHandler(httpMux, s.config.TileServerURL)
mux.PathPrefix("/map").Handler(httpMux)
mux.PathPrefix("/").Handler(http.FileServer(http.FS(frontendFS)))

Expand Down
1 change: 1 addition & 0 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Config struct {
GRPCListenAddr string
SpanToken string
SpanCollectionID string
TileServerURL string
}

// Create and start server instance.
Expand Down

0 comments on commit 7aabbb8

Please sign in to comment.