-
Notifications
You must be signed in to change notification settings - Fork 2
/
__init__.py
41 lines (28 loc) · 918 Bytes
/
__init__.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
30
31
32
33
34
35
36
37
38
39
40
41
# import os
# from flask import Flask
# from flask_restful import Resource, Api
# from flask_pymongo import PyMongo
# from flask import make_response
# from bson.json_util import dumps
# MONGO_URL = os.environ.get('MONGO_URL')
# if not MONGO_URL:
# MONGO_URL = "mongodb://localhost:27017/run"
# app = Flask(__name__)
# app.config['MONGO_URI'] = MONGO_URL
# mongo = PyMongo(app)
# def output_json(obj, code, headers=None):
# resp = make_response(dumps(obj), code)
# resp.headers.extend(headers or {})
# return resp
# DEFAULT_REPRESENTATIONS = {'application/json': output_json}
# api = Api(app)
# api.representations = DEFAULT_REPRESENTATIONS
# class Root(Resource):
# def get(self):
# return {
# 'status': 'OK',
# 'mongo': str(mongo.db),
# }
# api.add_resource(Root, '/')
# from xenon_runsDB_api.runs import *
# from xenon_runsDB_api.run import *