21 lines
421 B
Python
21 lines
421 B
Python
from flask import Flask, render_template, request
|
|
from publisher import publish_message
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
@app.route('/')
|
|
def index():
|
|
return render_template('index.html')
|
|
|
|
|
|
@app.route('/publish', methods=['GET'])
|
|
def publish():
|
|
message = request.form['message']
|
|
publish_message(message)
|
|
return 'Пациент прибыл: {}'.format(message)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app.run(debug=True)
|