Support setting fileserver upload folder using an environment variable

This commit is contained in:
allegroai 2020-02-26 17:26:46 +02:00
parent 8630cc1021
commit 4595117d91

View File

@ -14,6 +14,9 @@ app = Flask(__name__)
CORS(app, **config.get("fileserver.cors"))
Compress(app)
if os.environ.get("TRAINS_UPLOAD_FOLDER"):
app.config["UPLOAD_FOLDER"] = os.environ.get("TRAINS_UPLOAD_FOLDER")
@app.route("/", methods=["POST"])
def upload():