def main(): ctrl = Core(name="core") ctrl.loadJobs() cherrypy.config.update("web_rss.ini") cherrypy.config.update({'error_page.404': error_page_404}) #cherrypy.config.update({'server.socket_host': '147.229.205.40', 'server.socket_port': 8090, 'server.thread_pool': 4, 'log.screen': True}) rest_service = RESTService() rest_service.db = DbRESTService(ctrl) rest_service.ctrl = ControlRESTService(ctrl) cherrypy.tree.mount(rest_service, "/api/", config = {'/':{'request.dispatch':cherrypy.dispatch.MethodDispatcher()}}) conf = { '/static': { 'tools.staticdir.on':True, 'tools.staticdir.dir':current_dir + "/static" }, '/': {'tools.basic_auth.on': True, 'tools.basic_auth.realm': 'athena3.fit.vutbr.cz', 'tools.basic_auth.users': get_ulist, 'tools.basic_auth.encrypt': encrypt_pw} } cherrypy.engine.subscribe("stop", ctrl.stop) ctrl.start() cherrypy.quickstart(Root(ctrl), config = conf)
def main(): ctrl = Core(name="core") ctrl.loadJobs() cherrypy.config.update("web_rss.ini") cherrypy.config.update({'error_page.404': error_page_404}) #cherrypy.config.update({'server.socket_host': '147.229.205.40', 'server.socket_port': 8090, 'server.thread_pool': 4, 'log.screen': True}) rest_service = DbRESTService() cherrypy.tree.mount(rest_service, "/api/rest/", config = {'/':{'request.dispatch':cherrypy.dispatch.MethodDispatcher()}}) conf = { '/static': { 'tools.staticdir.on':True, 'tools.staticdir.dir':current_dir + "/static" }, } cherrypy.engine.subscribe("stop", ctrl.stop) ctrl.start() cherrypy.quickstart(Root(ctrl), config = conf)
def main(): ctrl = Core(name="core") ctrl.loadJobs() cherrypy.config.update("web_rss.ini") cherrypy.config.update({'error_page.404': error_page_404}) #cherrypy.config.update({'server.socket_host': '147.229.205.40', 'server.socket_port': 8090, 'server.thread_pool': 4, 'log.screen': True}) rest_service = RESTService() rest_service.db = DbRESTService(ctrl) rest_service.ctrl = ControlRESTService(ctrl) cherrypy.tree.mount(rest_service, "/api/", config={ '/': { 'request.dispatch': cherrypy.dispatch.MethodDispatcher() } }) conf = { '/static': { 'tools.staticdir.on': True, 'tools.staticdir.dir': current_dir + "/static" }, '/': { 'tools.basic_auth.on': True, 'tools.basic_auth.realm': 'athena3.fit.vutbr.cz', 'tools.basic_auth.users': get_ulist, 'tools.basic_auth.encrypt': encrypt_pw } } cherrypy.engine.subscribe("stop", ctrl.stop) ctrl.start() cherrypy.quickstart(Root(ctrl), config=conf)