-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathapp.py
More file actions
49 lines (42 loc) · 1.02 KB
/
app.py
File metadata and controls
49 lines (42 loc) · 1.02 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from flask import (
Flask,
jsonify,
request,
render_template,
)
from flasgger import Swagger
from datetime import datetime
app = Flask(__name__)
swagger = Swagger(app)
@app.route("/get_documents")
def get_documents():
"""Example endpoint returning features by id
This is using docstrings for specifications.
---
parameters:
- name: state
type: string
in: query
required: true
default: NJ
responses:
200:
description: A JSON of documents
schema:
id: Document ID
properties:
is_gt_18_years_old:
type: array
items:
schema:
id: value
type: number
"""
question = request.form["question"]
documents = store.get_online_documents(query)
return render_template("documents.html", documents=documents)
@app.route("/")
def home():
return render_template("home.html")
if __name__ == "__main__":
app.run(debug=True)