publapi/utils/port.go

15 lines
190 B
Go
Raw Normal View History

package utils
import (
"os"
)
// GetPort returns the port to listen on
func GetPort() string {
port := os.Getenv("PUBLAPI_PORT")
if port == "" {
port = "3000"
}
return ":" + port
}