def root(request):
"""Return the root endpoint, serve the index.html.
:param request: a web requeest object.
:type request: request | None
"""
log.info("Root page requested.")
index_file = open(index_path)
log.info("Serving %s", index_path)
resp = web.Response(body=index_file.read().encode('utf-8'))
resp.headers['content-type'] = 'text/html'
return resp
评论列表
文章目录