-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserver.py
More file actions
36 lines (24 loc) · 763 Bytes
/
server.py
File metadata and controls
36 lines (24 loc) · 763 Bytes
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
import os
import logging
from flask import Flask
from flask_cors import CORS
import flask
from bitstore import make_blueprint
SERVICE_NAME = os.environ.get('DATAHUB_SERVICE_NAME', 'rawstore')
# Create application
app = Flask(__name__, static_folder=None)
# CORS support
CORS(app, supports_credentials=True)
@app.errorhandler(404)
def page_not_found(error):
ascii_message = '''
'''
info = "%s service - part of the DataHub platform" % SERVICE_NAME
docs = "http://docs.datahub.io"
return flask.jsonify(info=info, docs=docs), 404
# Register blueprints
app.register_blueprint(make_blueprint(),
url_prefix='/%s/' % SERVICE_NAME)
logging.getLogger().setLevel(logging.INFO)
if __name__=='__main__':
app.run()