-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathview.py
More file actions
28 lines (21 loc) · 660 Bytes
/
view.py
File metadata and controls
28 lines (21 loc) · 660 Bytes
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
from flask import Flask, Response, render_template, request
from static.python.polly_req import PollySession
import sys
import os
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
@app.route('/documentation')
def documentation():
return render_template('documentation.html')
@app.route('/tips_and_tricks')
def tips_and_tricks():
return render_template('tips_and_tricks.html')
@app.post('/polly')
def polly_resp():
p = PollySession(request.json['ssml'])
return p.getMP3Blob()
if __name__ == "__main__":
port = int(os.environ.get('PORT', 5000))
app.run(debug=True, host='0.0.0.0', port=port)