annot-server/server.tac
author ymh <ymh.work@gmail.com>
Mon, 13 Oct 2014 12:43:47 +0200
changeset 13 435d5c15275a
parent 3 1b94e6e9579f
child 22 986ee928a866
permissions -rw-r--r--
clean client npm and gulp config, change flask root url, reference static url in template, change config management to follow flask convention


#
# See LICENCE for detail
# Copyright (c) 2014 IRI
#

import os.path
import sys

import psycopg2.extras

from twisted.application import service
from twisted.python import log
from txpostgres import txpostgres

from annotserver import make_service
import config
from models import get_table_create_stmt
from utils import create_connection_pool


psycopg2.extras.register_uuid()


conn, d = create_connection_pool(config.CONN_STR)
#to do treat error
d.addCallback(lambda _: conn.runOperation(get_table_create_stmt()))

#TOODO Log
#log.startLogging(sys.stdout)


application = service.Application("annot-server")

annotserver = make_service(conn)
annotserver.setServiceParent(service.IServiceCollection(application))