Commit 103754345878c35b64e889dc0c0c107d6ee62fe3
- Diff rendering mode:
- inline
- side by side
server.py
(3 / 3)
  | |||
31 | 31 | ||
32 | 32 | @app.route('/fetch', methods=['GET']) | |
33 | 33 | def fetch(): | |
34 | connection = pymongo.Connection() | ||
34 | connection = pymongo.MongoClient('localhost',27017) | ||
35 | 35 | db = connection['mural'] | |
36 | 36 | collection = db['data'] | |
37 | 37 | ret = {} | |
… | … | ||
58 | 58 | ||
59 | 59 | @app.route('/search', methods=['GET']) | |
60 | 60 | def search(): | |
61 | connection = pymongo.Connection() | ||
61 | connection = pymongo.MongoClient('localhost',27017) | ||
62 | 62 | db = connection['mural'] | |
63 | 63 | collection = db['data'] | |
64 | 64 | y = 0 | |
… | … | ||
97 | 97 | ||
98 | 98 | @app.route('/submit', methods=['POST']) | |
99 | 99 | def submit(): | |
100 | c = pymongo.Connection() | ||
100 | c = pymongo.MongoClient('localhost',27017) | ||
101 | 101 | db = c['mural'] | |
102 | 102 | coll = db['data'] | |
103 | 103 | requestData = json.loads(request.form['data']) |