-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
29 lines (23 loc) · 790 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from flask import Flask, render_template, redirect, session, request, jsonify
from wtforms import Form, StringField, TextAreaField, PasswordField, validators
from models.form import EMSForm
from flask_bootstrap import Bootstrap
from speech_to_model import interpret_transcript
app = Flask(__name__)
app.debug = True
bootstrap = Bootstrap(app)
@app.route('/')
def index():
emsForm = EMSForm(request.form)
return render_template('home.html', ems=emsForm)
# @socketio.on( 'parse ems' )
# def handle_parse_ems():
# result = interpret_transcript()
# socketio.emit('my response', jsonify(result))
@app.route( '/parse_ems' )
def handle_parse_ems():
result = interpret_transcript()
return jsonify(result)
if __name__ == '__main__':
app.secret_key = 'secret123'
app.run()