Fixup port env var

This commit is contained in:
Marcin Jachymiak 2020-03-03 18:29:17 -05:00
parent cbe73e14c7
commit 64681bf19d
1 changed files with 7 additions and 2 deletions

View File

@ -3,11 +3,16 @@
from urllib.request import urlopen, Request from urllib.request import urlopen, Request
import urllib, json, os, traceback, discord import urllib, json, os, traceback, discord
portal_name = os.environ["PORTAL_NAME"] # Get a port or use default
port = os.getenv("API_PORT")
if not port:
port = "9980"
api_endpoint = "http://localhost:{}".format(port)
portal_name = os.getenv("PORTAL_NAME")
# sc_precision is the number of hastings per siacoin # sc_precision is the number of hastings per siacoin
sc_precision = 10 ** 24 sc_precision = 10 ** 24
api_endpoint = "http://localhost:9980" # TODO get port from env/param
# Discord bot initialization # Discord bot initialization
bot_token = os.environ["DISCORD_BOT_TOKEN"] bot_token = os.environ["DISCORD_BOT_TOKEN"]