def setup_server():
class Root:
@cherrypy.expose
def index(self):
return "hello"
origins = 'http://example.com', 'https://example.com'
config = {
'/': {
'cors.expose.on': True,
'cors.expose.origins': origins,
'cors.preflight.origins': origins,
},
}
cherrypy.tree.mount(Root(), config=config)
cherrypy_cors.install()
评论列表
文章目录