From 3625f3ab96bac172ad440dc040f4e0a4ee247249 Mon Sep 17 00:00:00 2001
From: David Trattnig <david.trattnig@o94.at>
Date: Fri, 13 Mar 2020 13:35:52 +0100
Subject: [PATCH] Run API service in production.

---
 run.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/run.sh b/run.sh
index 9d143fb..eb68639 100755
--- a/run.sh
+++ b/run.sh
@@ -5,7 +5,7 @@ debug="--debug"
 
 
 if [ -n "$1" ]; then
-	if [[ $1 =~ ^(engine|lqs|api)$ ]]; then 
+	if [[ $1 =~ ^(engine|lqs|api|api-prod)$ ]]; then 
   		mode=$1 
 	fi
 fi
@@ -25,4 +25,11 @@ if [ $mode == "api" ]; then
 	sh ./script/build-web.sh
 	echo "Starting API Server"
 	/usr/bin/python3.7 api.py
+fi
+
+if [ $mode == "api-prod" ]; then
+	echo "Building Web Applications"
+	sh ./script/build-web.sh
+	echo "Starting API Server"
+	gunicorn -c configuration/gunicorn.conf.py api:app
 fi
\ No newline at end of file
-- 
GitLab