def text_response():
    return http.HTMLResponse("Hello, world!")
Example #2
0
def Return(return_value):
    if isinstance(return_value, str):
        return_value = http.HTMLResponse(return_value)
    elif not isinstance(return_value, http.Response):
        return_value = http.JSONResponse(return_value)
    raise HookReturn(return_value)
Example #3
0
def template_handler(app: App, name: str = None) -> http.HTMLResponse:
    return http.HTMLResponse(app.render_template('test.html', name=name))