Commit 52dd1139 authored by Romain Loth's avatar Romain Loth

move backend into new services folder for later merge with db_to_tina_api from...

move backend into new services folder for later merge with db_to_tina_api from moma/legacy_php_comex/commit/4d19264a + add stubs for future user login and text normalization classes
parent cd84cd5d
......@@ -74,9 +74,10 @@ source setup/regcomex_config.ini
Then to run the regcomex app in the simplest way just do:
```
python3 server_comex_registration.py
cd services
python3 comex_main_backend.py
```
The form server is then accessible locally on `127.0.0.1:5000/regcomex`
The form server is then accessible locally on `0.0.0.0:5000/regcomex`
-------
......@@ -135,7 +136,7 @@ export DOORS_PORT=8989
##### 3) Run the regomex app with gunicorn
```
gunicorn -b 0.0.0.0:9090 server_comex_registration:app
bash run.sh
```
The form server is then accessible locally on `0.0.0.0:9090/regcomex`
......
#! /bin/bash
#
# simple web server running server_comex_registration:app
# simple web server running services/comex_main_backend:app
if [ -z "$HOST" ]
then export HOST="0.0.0.0"
......@@ -9,11 +9,11 @@ fi
if [ "$DEBUG_FLAG" != true ]
then
gunicorn -b $HOST:9090 server_comex_registration:app
gunicorn -b $HOST:9090 services.comex_main_backend:app
else
gunicorn -b $HOST:9090 \
--log-level debug \
server_comex_registration:app
services.comex_main_backend:app
# --access-logfile test_gu_access.log
# --error-logfile test_gu_error.log
fi
......@@ -30,6 +30,15 @@ from re import sub
from os import environ
from traceback import format_tb
if __package__ == 'services':
# when we're run via import
from services.user import comex_user
from services.text import keywords
else:
# when this script is run directly
from user import comex_user
from text import keywords
# ============= read environ =============
MY_HOST = environ.get('HOST', '0.0.0.0')
MY_DEBUG_FLAG = environ.get('DEBUG_FLAG') == 'true'
......@@ -44,7 +53,7 @@ if MY_DEBUG_FLAG:
# TODO add doors port if != 8989
# ============= app creation =============
app = Flask(__name__)
app = Flask("services", static_folder="../static", template_folder="../templates")
app.config['DEBUG'] = MY_DEBUG_FLAG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment