Skip to content
Snippets Groups Projects
Commit cf4bb72a authored by Antoine Pérus's avatar Antoine Pérus
Browse files

Merge branch 'simpler-run' into 'master'

Change the way the Flask app is launched

See merge request PSPA/pspa-cgi-poc!5
parents a80004a2 c03d0440
Branches master
No related tags found
No related merge requests found
......@@ -45,12 +45,7 @@ python3.exe setup.py build_ext --inplace && rm -f pyelements.c && rm -Rf build
# serve back-end at localhost:5000
cd ..
# Unix platforms:
FLASK_APP=pspa.py FLASK_DEBUG=1 flask run
# Windows:
set FLASK_APP=pspa.py
set FLASK_DEBUG=1
flask run
python pspa.py
```
## Using with Docker
......@@ -79,7 +74,7 @@ Then launch flask
```bash
cd /app
FLASK_APP=pspa.py FLASK_DEBUG=1 flask run --host 0.0.0.0
python pspa.py
```
Do not forget the `host` as docker is very picky about it ;-) If all goes right, you should see:
......
pspa.py 100644 → 100755
#!/usr/bin/env python
from flask import Flask, render_template, jsonify
from flask_cors import CORS
import requests
......@@ -70,3 +72,7 @@ def catch_all(path):
if app.debug:
return requests.get('http://localhost:8080/{}'.format(path)).text
return render_template("index.html")
if __name__ == "__main__":
app.run("0.0.0.0", port=5000, debug=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment