This commit is contained in:
mithereal 2022-07-30 16:35:47 -07:00
parent a76046a41b
commit a6e0c34abe
5 changed files with 10 additions and 11 deletions

View File

@ -6,10 +6,6 @@
"keywords": ["elixir", "farside" ],
"env": {
"MIX_ENV": "prod",
"FARSIDE_PORT": {
"description": "The Port Farside is running on",
"value": "443"
},
"FARSIDE_SERVICES_JSON": {
"description": "The json of services available",
"value": "",

View File

@ -14,5 +14,4 @@ config :farside,
queries: [
"weather",
"time"
],
services_json_data: System.get_env("FARSIDE_SERVICES_JSON") || ""
]

View File

@ -1,5 +1,6 @@
import Config
config :farside,
port: System.get_env("FARSIDE_PORT", "4001"),
services_json: System.get_env("FARSIDE_SERVICES_JSON", "services.json")
port: System.get_env("FARSIDE_PORT", nil),
services_json: System.get_env("FARSIDE_SERVICES_JSON", "services.json"),
services_json_data: System.get_env("FARSIDE_SERVICES_JSON_DATA") || ""

View File

@ -6,5 +6,4 @@ build:
web: exec /opt/app/bin/server start
config:
MIX_ENV: prod
FARSIDE_PORT: $FARSIDE_PORT
FARSIDE_SERVICES_JSON: $FARSIDE_SERVICES_JSON
FARSIDE_SERVICES_JSON_DATA: $FARSIDE_SERVICES_JSON_DATA

View File

@ -11,7 +11,11 @@ defmodule Farside.Application do
@impl true
def start(_type, _args) do
port = Application.fetch_env!(:farside, :port)
port =
case Application.fetch_env!(:farside, :port) do
nil -> System.get_env("PORT")
port -> port
end
Logger.info("Running on http://localhost:#{port}")