Example #1
0
import sys
from werkzeug.serving import WSGIRequestHandler
import os

from pychunkedgraph.app import create_app

app = create_app()

if __name__ == '__main__':

    assert len(sys.argv) == 3
    HOME = os.path.expanduser("~")

    table_id = sys.argv[1]
    port = int(sys.argv[2])
    app.config['CHUNKGRAPH_TABLE_ID'] = table_id

    # Initialize chunkedgraph:
    # cg = chunkedgraph.ChunkedGraph(table_id=table_id)

    # Initialize google pubsub publisher
    # publisher = pubsub_v1.PublisherClient()
    # topic_path = publisher.topic_path('neuromancer-seung-import',
    #                                   'pychunkedgraph')

    # Set HTTP protocol
    WSGIRequestHandler.protocol_version = "HTTP/1.1"
    # WSGIRequestHandler.protocol_version = "HTTP/2.0"

    print("Table: %s; Port: %d; Log-Path: %s" %
          (table_id, port, app.config['LOGGING_LOCATION']))
Example #2
0
from werkzeug.serving import WSGIRequestHandler
from pychunkedgraph.app import create_app

application = create_app()

if __name__ == "__main__":

    WSGIRequestHandler.protocol_version = "HTTP/1.1"

    application.run(host='0.0.0.0',
                    port=80,
                    debug=False,
                    threaded=True,
                    ssl_context='adhoc')

Example #3
0
def app():
    app = create_app({'TESTING': True, 'BIGTABLE_CONFIG': {'emulate': True}})
    yield app