summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-11-26 14:45:41 +0100
committerMS <ms@taler.net>2020-11-26 14:45:41 +0100
commite958a4a2a149d80e1eea3fc924a563b0e79cf667 (patch)
treee8d5da6fb7d53cf2d4be6fad55735b364eb79d68
parent46dc74047a5d876a05e1517186f173afa8b059cb (diff)
downloadlibeufin-deployment-e958a4a2a149d80e1eea3fc924a563b0e79cf667.tar.gz
libeufin-deployment-e958a4a2a149d80e1eea3fc924a563b0e79cf667.tar.bz2
libeufin-deployment-e958a4a2a149d80e1eea3fc924a563b0e79cf667.zip
util
-rw-r--r--util/server.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/util/server.py b/util/server.py
new file mode 100644
index 0000000..3235a4d
--- /dev/null
+++ b/util/server.py
@@ -0,0 +1,49 @@
+##
+# This file is part of GNU TALER.
+# Copyright (C) 2014-2017 INRIA
+#
+# TALER is free software; you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free Software
+# Foundation; either version 2.1, or (at your option) any later version.
+#
+# TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License along with
+# GNU TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+#
+# @author Florian Dold
+# @author Marcello Stanisci
+# @brief Implementation of a Taler-compatible blog.
+
+import urllib.parse
+from urllib.parse import urljoin, quote, urlencode
+import logging
+import os
+import traceback
+import uuid
+import flask
+import json
+
+BASE_DIR = os.path.dirname(os.path.abspath(__file__))
+app = flask.Flask(__name__, template_folder=BASE_DIR)
+
+LOGGER = logging.getLogger(__name__)
+app.config.from_object(__name__)
+
+##
+# Serve the main index page.
+#
+# @return response object of the index page.
+@app.route("/", defaults={"path": ""}, methods=["GET", "POST"])
+@app.route("/<path:path>", methods=["GET", "POST"])
+def index(path):
+
+ if "POST" == flask.request.method:
+ body = flask.request.get_data().decode("utf-8")
+ print("LOGGING REQUEST BODY:")
+ # print(json.dumps(body, indent=1))
+ print(body)
+
+ return "ebicstest1"