You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

20 lines
523 B

import os
import asyncio
import aiohttp
import aiofiles
dir = os.path.dirname(__file__)
routes = aiohttp.RouteTableDef()
app = aiohttp.web.Application()
app.router.add_static("/static/",
path=os.path.join(dir, "static"),
name="static")
@routes.get("/")
async def index():
async with aiofiles.open(os.path.join(dir, "static", "index.html")) as conn:
return web.Response(text=conn.read(), content_type="text/html")
if __name__ == "__main__":
aiohttp.runapp(app)