mirror of
https://github.com/gomods/athens
synced 2026-02-03 11:00:32 +00:00
Olympus: default to PORT env var (#226)
* Olympus: default to PORT env var * Athens: generalize env.Port function call * Olympus: add PORT to .env
This commit is contained in:
committed by
Aaron Schlesinger
parent
514ac49659
commit
f1d66d9d45
@@ -1 +1,2 @@
|
||||
ATHENS_MONGO_STORAGE_URL=mongodb://127.0.0.1:27017
|
||||
PORT=3001
|
||||
|
||||
@@ -46,7 +46,7 @@ var (
|
||||
func App() *buffalo.App {
|
||||
if app == nil {
|
||||
redisPort := env.OlympusRedisQueuePortWithDefault(":6379")
|
||||
port := env.OlympusHTTPPort(":3001")
|
||||
port := env.Port(":3001")
|
||||
|
||||
app = buffalo.New(buffalo.Options{
|
||||
Addr: port,
|
||||
|
||||
Vendored
-6
@@ -6,9 +6,3 @@ import "github.com/gobuffalo/envy"
|
||||
func OlympusGlobalEndpointWithDefault(value string) string {
|
||||
return envy.Get("OLYMPUS_GLOBAL_ENDPOINT", value)
|
||||
}
|
||||
|
||||
// OlympusHTTPPort returns the port that the olympus server is running on;
|
||||
// should default to 3001.
|
||||
func OlympusHTTPPort(value string) string {
|
||||
return envy.Get("OLYMPUS_HTTP_PORT", value)
|
||||
}
|
||||
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
package env
|
||||
|
||||
import "github.com/gobuffalo/envy"
|
||||
|
||||
// Port returns the PORT env var that a server (Olympus/Zeus) should
|
||||
// run on. Buffalo uses the PORT environment so this keeps it consistent
|
||||
// but can also be used directly as a Buffalo service option
|
||||
func Port(value string) string {
|
||||
return envy.Get("PORT", value)
|
||||
}
|
||||
Reference in New Issue
Block a user