archive
/
lantern
Archived
1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
lantern/lantern/route.py

14 lines
396 B
Python

from sanic.response import html
from lantern.handle import execute_handle
from lantern.error import error_response
import os
async def main_route(request, path=None):
handle = os.path.join(os.path.dirname(__file__), 'test_handle.py')
result = execute_handle(handle, {})
if result.exit_code != 0:
return error_response(result.error)
return html(result.html, status=200)