REST.Server({ # Clients "/client": {"methods": REST.ALL, "session": True}, "/clients": {"methods": REST.READ, "session": True}, # Companies "/company": {"methods": REST.READ | REST.UPDATE, "session": True}, # Invoices "/invoice": {"methods": REST.CREATE | REST.READ, "session": True}, "/invoice/pdf": {"methods": REST.READ, "session": True}, "/invoices": {"methods": REST.READ, "session": True}, # Projects "/project": {"methods": REST.ALL, "session": True}, "/projects": {"methods": REST.READ, "session": True}, # Tasks "/task/start": {"methods": REST.CREATE, "session": True}, "/task/end": {"methods": REST.UPDATE, "session": True}, "/task": {"methods": REST.UPDATE | REST.DELETE, "session": True}, "/tasks": {"methods": REST.READ, "session": True}, # Users "/user": {"methods": REST.ALL, "session": True}, "/user/passwd": {"methods": REST.UPDATE, "session": True}, "/user/access": {"methods": REST.CREATE | REST.DELETE | REST.READ, "session": True}, "/users": {"methods": REST.READ, "session": True}, # Session "/signin": {"methods": REST.POST}, "/signout": {"methods": REST.POST, "session": True}, # User Access "/account/clients": {"methods": REST.READ, "session": True}, "/account/forgot": {"methods": REST.CREATE | REST.UPDATE}, "/account/setup": {"methods": REST.READ | REST.UPDATE}, "/account/task": {"methods": REST.READ, "session": True}, "/account/tasks": {"methods": REST.READ, "session": True}, "/account/verify": {"methods": REST.UPDATE} }, 'primary', "https?://(.*\\.)?%s" % Conf.get(("rest","allowed")).replace('.', '\\.')).run( host=oRestConf['primary']['host'], port=oRestConf['primary']['port'], workers=oRestConf['primary']['workers'], timeout='timeout' in oRestConf['primary'] and oRestConf['primary']['timeout'] or 30 )
}, oRestConf, Conf.get(('services', 'salt'))) # Create the HTTP server and map requests to service REST.Server( { "/clear": { "methods": REST.UPDATE, "session": True }, "/join": { "methods": REST.CREATE, "session": True }, "/leave": { "methods": REST.CREATE, "session": True }, "/pull": { "methods": REST.READ, "session": True }, "/websocket": { "methods": REST.READ, "session": True } }, 'webpoll', "https?://(.*\\.)?%s" % Conf.get( ("domain", "primary")).replace('.', '\\.')).run( host=oRestConf['webpoll']['host'], port=oRestConf['webpoll']['port'], workers=oRestConf['webpoll']['workers'])
# Load the config Conf.load('../config.json') sConfOverride = '../config.%s.json' % platform.node() if os.path.isfile(sConfOverride): Conf.load_merge(sConfOverride) # Init the SMTP module SMTP.init(**Conf.get(('email', 'smtp'))) # Create the REST config instance oRestConf = REST.Config(Conf.get("rest")) # Set verbose mode if requested if 'AXE_VERBOSE' in os.environ and os.environ['AXE_VERBOSE'] == '1': Services.verbose() # Register the Services that will be accessible Services.register({ "communications": Communications() }, oRestConf, Conf.get(('services', 'salt'))) # Create the HTTP server and map requests to service REST.Server({ "/email": {"methods": REST.POST}, "/sms": {"methods": REST.POST}, }, 'communications').run( host=oRestConf['communications']['host'], port=oRestConf['communications']['port'], workers=oRestConf['communications']['workers'] )
if 'AXE_VERBOSE' in os.environ and os.environ['AXE_VERBOSE'] == '1': Services.verbose() # Register all necessary services Services.register({ "auth": None, "watl": Watl() }, oRestConf, Conf.get(('services', 'salt'))) # Create the HTTP server and map requests to service REST.Server({ "/match": {"methods": REST.CREATE | REST.DELETE | REST.READ, "session": True}, "/match/overtime": {"methods": REST.UPDATE, "session": True}, "/match/finish/overtime": {"methods": REST.UPDATE, "session": True}, "/match/finish/game": {"methods": REST.UPDATE, "session": True}, "/match/game": {"methods": REST.UPDATE, "session": True}, "/match/stats": {"methods": REST.READ, "session": True}, "/match/unfinished": {"methods": REST.READ, "session": True}, "/practice": {"methods": REST.CREATE, "session": True}, "/practice/data": {"methods": REST.READ, "session": True}, "/practice/pattern": {"methods": REST.CREATE | REST.DELETE | REST.UPDATE, "session": True}, "/practice/patterns": {"methods": REST.READ, "session": True}, "/practice/stats": {"methods": REST.READ, "session": True} }, 'watl', "https?://(.*\\.)?%s" % Conf.get(("domain","primary")).replace('.', '\\.')).run( host=oRestConf['watl']['host'], port=oRestConf['watl']['port'], workers=oRestConf['watl']['workers'] )
REST.Server( { "/favourite": { "method": REST.CREATE | REST.DELETE, "session": True }, "/favourites": { "method": REST.READ, "session": True }, "/match/request": { "methods": REST.ALL, "session": True }, "/match/requests": { "methods": REST.READ, "session": True }, "/passwd/forgot": { "methods": REST.CREATE | REST.UPDATE }, "/search": { "methods": REST.READ, "session": True }, "/session": { "methods": REST.READ, "session": True }, "/signin": { "methods": REST.POST }, "/signout": { "methods": REST.POST, "session": True }, "/signup": { "methods": REST.POST }, "/thrower": { "methods": REST.READ | REST.UPDATE, "session": True }, "/thrower/alias": { "methods": REST.UPDATE, "session": True }, "/thrower/aliases": { "methods": REST.READ }, "/thrower/email": { "methods": REST.UPDATE, "session": True }, "/thrower/org": { "methods": REST.UPDATE, "session": True }, "/thrower/passwd": { "methods": REST.UPDATE, "session": True }, "/thrower/verify": { "methods": REST.UPDATE } }, 'auth', "https?://(.*\\.)?%s" % Conf.get( ("domain", "primary")).replace('.', '\\.')).run( host=oRestConf['auth']['host'], port=oRestConf['auth']['port'], workers=oRestConf['auth']['workers'])