1
0
Fork 0
mirror of https://github.com/benbusby/farside.git synced 2025-06-08 02:16:36 +00:00
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" ], "keywords": ["elixir", "farside" ],
"env": { "env": {
"MIX_ENV": "prod", "MIX_ENV": "prod",
"FARSIDE_PORT": {
"description": "The Port Farside is running on",
"value": "443"
},
"FARSIDE_SERVICES_JSON": { "FARSIDE_SERVICES_JSON": {
"description": "The json of services available", "description": "The json of services available",
"value": "", "value": "",

View file

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

View file

@ -1,5 +1,6 @@
import Config import Config
config :farside, config :farside,
port: System.get_env("FARSIDE_PORT", "4001"), port: System.get_env("FARSIDE_PORT", nil),
services_json: System.get_env("FARSIDE_SERVICES_JSON", "services.json") 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 web: exec /opt/app/bin/server start
config: config:
MIX_ENV: prod MIX_ENV: prod
FARSIDE_PORT: $FARSIDE_PORT FARSIDE_SERVICES_JSON_DATA: $FARSIDE_SERVICES_JSON_DATA
FARSIDE_SERVICES_JSON: $FARSIDE_SERVICES_JSON

View file

@ -11,7 +11,11 @@ defmodule Farside.Application do
@impl true @impl true
def start(_type, _args) do 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}") Logger.info("Running on http://localhost:#{port}")