From 6aa35624247796b779172c1e056fbd88412226e0 Mon Sep 17 00:00:00 2001 From: Me Date: Sat, 19 Dec 2020 00:34:20 +0000 Subject: [PATCH] Look for energyDB.conf also in the parent folder + add the DB url to the config file --- start_server.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/start_server.sh b/start_server.sh index 014b164..689dae1 100755 --- a/start_server.sh +++ b/start_server.sh @@ -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