DAS_2023_1/antonov_dmitry_lab4/rabbitmq/app.py
DmitriyAntonov ca5364cb65 good start
2023-12-04 22:18:07 +04:00

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)