import json
import os

from appPublic.worker import awaitify
from appPublic.registerfunction import RegisterFunction
from appPublic.jsonConfig import getConfig
from ahserver.serverenv import ServerEnv
from ahserver.webapp import webapp
from rbac.init import load_rbac
from msp.init import load_msp
from ext import load_bricksExt

from time import time

def get_module_dbname(mname):
	return "msp"

def init_func():
	g = ServerEnv()
	g.get_module_dbname = get_module_dbname
	rf = RegisterFunction()
	rf.register('get_module_dbname', get_module_dbname)
	load_msp()
	load_rbac()
	load_bricksExt()

if __name__ == '__main__':
    webapp(init_func)

