diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/db.py | 8 | ||||
-rwxr-xr-x | src/wsgi.py | 6 |
2 files changed, 7 insertions, 7 deletions
@@ -46,18 +46,18 @@ class DictDB(): return self._ts def add(self, data, batch_write=False): - key = str(self.unique_key()) + keys = [] if type(data) is list: for item in data: - item['_id'] = str(self._ts) + item['_id'] = str(self.unique_key()) self.couchdb.save(item) else: - data['_id'] = str(self._ts) + data['_id'] = str(self.unique_key()) self.couchdb.save(data) - return key + return keys def get(self, key): return self.couchdb[key] diff --git a/src/wsgi.py b/src/wsgi.py index 15f9224..3c3d363 100755 --- a/src/wsgi.py +++ b/src/wsgi.py @@ -99,12 +99,12 @@ class EPAdd(CollectorResource): resp.text = CollectorResource.parse_error(decodedin) return - key = self._db.add(json_data) - resp.text = repr(key) + '\n' + keys = self._db.add(json_data) + resp.text = repr(keys) + '\n' def init(url_res_map, addr='', port=8000): - app = falcon.App() + app = falcon.App(cors_enable=True) for url, res in url_res_map: app.add_route(url, res) return make_server(addr, port, app) |