mirror of
https://github.com/benbusby/farside.git
synced 2025-04-19 14:55:50 -04:00
refactor
This commit is contained in:
parent
a76046a41b
commit
a6e0c34abe
4
app.json
4
app.json
@ -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": "",
|
||||
|
@ -14,5 +14,4 @@ config :farside,
|
||||
queries: [
|
||||
"weather",
|
||||
"time"
|
||||
],
|
||||
services_json_data: System.get_env("FARSIDE_SERVICES_JSON") || ""
|
||||
]
|
||||
|
@ -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") || ""
|
||||
|
@ -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
|
@ -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}")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user