http.go

 1package config
 2
 3// HTTPConfig is the HTTP configuration for the server.
 4type HTTPConfig struct {
 5	// ListenAddr is the address on which the HTTP server will listen.
 6	ListenAddr string `env:"LISTEN_ADDR" yaml:"listen_addr"`
 7
 8	// TLSKeyPath is the path to the TLS private key.
 9	TLSKeyPath string `env:"TLS_KEY_PATH" yaml:"tls_key_path"`
10
11	// TLSCertPath is the path to the TLS certificate.
12	TLSCertPath string `env:"TLS_CERT_PATH" yaml:"tls_cert_path"`
13
14	// PublicURL is the public URL of the HTTP server.
15	PublicURL string `env:"PUBLIC_URL" yaml:"public_url"`
16}
17
18// Environ returns the environment variables for the config.
19func (h HTTPConfig) Environ() []string {
20	return []string{
21		"SOFT_SERVE_HTTP_LISTEN_ADDR=" + h.ListenAddr,
22		"SOFT_SERVE_HTTP_TLS_KEY_PATH=" + h.TLSKeyPath,
23		"SOFT_SERVE_HTTP_TLS_CERT_PATH=" + h.TLSCertPath,
24		"SOFT_SERVE_HTTP_PUBLIC_URL=" + h.PublicURL,
25	}
26}