From ea44d38a0dcc09708d0fb4fb02276884800b0b42 Mon Sep 17 00:00:00 2001 From: "max.mehl" Date: Tue, 18 May 2021 19:53:31 +0200 Subject: [PATCH] add wsgi/gunicorn --- autoreply_editor/main.py | 3 ++- wsgi.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 wsgi.py diff --git a/autoreply_editor/main.py b/autoreply_editor/main.py index 20a5e48..9cd7530 100644 --- a/autoreply_editor/main.py +++ b/autoreply_editor/main.py @@ -10,7 +10,8 @@ def index(): @app.route('/', methods=['POST']) def index_post(): - input_message = request.form['message'] + '\n' + input_message = request.form['message'] + if request.method == 'POST': with open(app.config.get("MESSAGE_FILE"), 'w') as f: f.write(str(input_message)) diff --git a/wsgi.py b/wsgi.py new file mode 100644 index 0000000..96640b0 --- /dev/null +++ b/wsgi.py @@ -0,0 +1,4 @@ +from autoreply_editor import app + +if __name__ == "__main__": + app.run()