Commit 71387e9c authored by Timothy Gillespie's avatar Timothy Gillespie

For testing on the server

parent c791f2e8
......@@ -6,7 +6,6 @@ import requests
import telegram_notificator
import os
script_path = os.path.dirname(os.path.realpath(__file__))
server_config_path = os.path.join(script_path, "server_conf.json")
......@@ -26,13 +25,28 @@ if telegram_api_key is None or application_website is None:
app = Flask(__name__)
@app.route("/<string:code>/", methods=["POST"])
@app.route("/", methods=["POST", "GET"])
def say_hello():
return "Hello"
@app.route("/<string:code>/", methods=["POST", "GET"])
def get_chat_id(code):
chat_id = escape(code)
website_html = ""
website_html = """
<form action="/start/" method="post">
Email: <input type="text" name="email"/><br />
Password: <input type="password" name="password" /><br />
<input type="hidden" value="{}" name="chat_id">
<input type="Submit" value="Starten">
return website
return website_html
@app.route("/bot/" + telegram_api_key + "/", methods=["POST"])
......@@ -72,5 +86,5 @@ if __name__ == "__main__ ":
# To run the server:
# flask run --cert=cert.pem --key=key.pem'cert.pem', 'key.pem'))
\ No newline at end of file
from import app
if __name__ == "__main__":
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment