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:
Marwan Sulaiman
2018-07-09 16:26:43 -04:00
committed by Aaron Schlesinger
parent 514ac49659
commit f1d66d9d45
4 changed files with 12 additions and 7 deletions
+1
View File
@@ -1 +1,2 @@
ATHENS_MONGO_STORAGE_URL=mongodb://127.0.0.1:27017
PORT=3001
+1 -1
View File
@@ -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,
-6
View File
@@ -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)
}
+10
View File
@@ -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)
}