Look for energyDB.conf also in the parent folder + add the DB url to the config file

This commit is contained in:
Me 2020-12-19 00:34:20 +00:00
parent e0317772e8
commit 6aa3562424

View file

@ -5,10 +5,16 @@
ENERGY_DB_CONF=./energyDB.conf
if [ -f $ENERGY_DB_CONF ]; then
. energyDB.conf
echo Reading $ENERGY_DB_CONF
source $ENERGY_DB_CONF
elif [ -f ../$ENERGY_DB_CONF ]; then
echo Reading ../$ENERGY_DB_CONF
source ../$ENERGY_DB_CONF
fi
ARG_HTTP_PORT=${HTTP_PORT:-8000}
ARG_IP_ADDRESS=${IP_ADDRESS:-127.0.0.1}
export DB_URL=${DATABASE_URL:-sqlite://}
/usr/bin/env uvicorn --port $ARG_HTTP_PORT --host $ARG_IP_ADDRESS ${UVICORN_ARGS} srv:energyDB