def setup_server():
class Root:
@cherrypy.expose
def index(self):
return "hello"
pattern = re.compile(r'(http|https)://svr[1-9]\.example\.com')
config = {
'/': {
'cors.expose.on': True,
'cors.expose.origins': [pattern],
'cors.preflight.origins': [pattern],
},
}
cherrypy.tree.mount(Root(), config=config)
cherrypy_cors.install()
评论列表
文章目录