Starting point
Change-Id: I86dab2674688f6d818ce2fb0861ea893d6841df3
diff --git a/src/web_server/__init__.py b/src/web_server/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/web_server/__init__.py
diff --git a/src/web_server/main.py b/src/web_server/main.py
new file mode 100644
index 0000000..b1e2758
--- /dev/null
+++ b/src/web_server/main.py
@@ -0,0 +1,30 @@
+from flask import Flask, make_response, request
+from tosca.parser import TOSCA_Parser
+
+BANNER = """
+ _ ______ _____ __________ _____ _________
+ | |/ / __ \/ ___/ /_ __/ __ \/ ___// ____/ |
+ | / / / /\__ \ / / / / / /\__ \/ / / /| |
+ / / /_/ /___/ / / / / /_/ /___/ / /___/ ___ |
+/_/|_\____//____/ /_/ \____//____/\____/_/ |_|
+"""
+
+class TOSCA_WebServer:
+ app = Flask('TOSCA-Web-Server')
+
+ @app.route("/", methods=['GET', 'POST'])
+ def home():
+ if request.method == 'GET':
+ response = make_response(BANNER)
+ response.headers["content-type"] = "text/plain"
+ return response
+ else:
+ try:
+ # print request.headers['xos-password']
+ parsed = TOSCA_Parser(request.get_data())
+ return make_response(str(parsed.ordered_names), 201)
+ except Exception, e:
+ return make_response(e.message, 400)
+
+ def __init__(self):
+ self.app.run(host='localhost', port='9200')
\ No newline at end of file