forked from emarco177/ice_breaker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
29 lines (23 loc) · 775 Bytes
/
app.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, request, jsonify
from ice_breaker import ice_break_with
app = Flask(__name__)
# to launch Flash app, from console run: FLASK_APP=app.py flask run
@app.route("/")
def index():
return render_template("index.html")
@app.route("/process", methods=["POST"])
def process():
name = request.form["name"]
summary_and_facts, interests, ice_breakers, profile_pic_url = ice_break_with(
name=name
)
return jsonify(
{
"summary_and_facts": summary_and_facts.to_dict(),
"interests": interests.to_dict(),
"ice_breakers": ice_breakers.to_dict(),
"picture_url": profile_pic_url,
}
)
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)