Last active
December 7, 2016 16:52
-
-
Save ovnicraft/86a58ff61438ff518415a6208a2efac0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from aiohttp import web | |
from routers import routers | |
from aiohttp_session.cookie_storage import EncryptedCookieStorage | |
import aiohttp_cors | |
loop = asyncio.get_event_loop() | |
app = web.Application(loop=loop) | |
aiohttp_cors.setup(app, defaults={ | |
'http://localhost:3000': aiohttp_cors.ResourceOptions( | |
allow_methods=['GET'], | |
expose_headers='*', | |
allow_headers='*' | |
) | |
}) | |
for router in routers: | |
app.router.add_route(router[0], router[1], router[2], name=router[3]) | |
web.run_app(app) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no Cross Origin in your case: all your code is executed on local host.