# -*- coding: utf-8 -*-
from aiohttp import web

__all__ = ['get_index']


async def get_index(request):
    index_html = request.config_dict.get('INDEX_HTML', None)
    if not index_html:
        return web.Response(
            content_type='text/plain',
            charset='utf-8',
            text='404: Not Found',
        )

    return web.Response(
        content_type='text/html',
        charset='utf-8',
        text=index_html,
    )
