Skip to content

Commit 6707be3

Browse files
committed
update environment variable for HTTP API port configuration
1 parent 4fe84a6 commit 6707be3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export HONEYCOMB_API_KEY=your_api_key_here
22
export HONEYCOMB_DATASET=cli-telemetry
33
export HONEYCOMB_API_URL=https://api.eu1.honeycomb.io
4-
export PORT=8080
4+
export HTTP_API_PORT=8080

internal/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
// Environment variables
88
type Config struct {
9-
Port string `envconfig:"PORT" default:"8080"`
9+
HTTPAPIPort string `envconfig:"HTTP_API_PORT" default:"8080"`
1010
HoneycombAPIKey string `envconfig:"HONEYCOMB_API_KEY"`
1111
HoneycombDataset string `envconfig:"HONEYCOMB_DATASET" default:"cli-telemetry"`
1212
HoneycombAPIURL string `envconfig:"HONEYCOMB_API_URL"`

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func main() {
1818
http.HandleFunc("/ping", handlePing)
1919
http.HandleFunc("/telemetry/event", middleware.CORS(forwarder.TelemetryCollectHandler(cfg)))
2020

21-
addr := fmt.Sprintf(":%s", cfg.Port)
21+
addr := fmt.Sprintf(":%s", cfg.HTTPAPIPort)
2222
log.Printf("Starting telemetry server on %s", addr)
2323
log.Fatal(http.ListenAndServe(addr, nil))
2424
}

0 commit comments

Comments
 (0)